@cyberskill/shared 1.137.0 → 1.139.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 (356) hide show
  1. package/README.md +4 -4
  2. package/dist/_tsup-dts-rollup.d.cts +43 -289
  3. package/dist/_tsup-dts-rollup.d.ts +43 -289
  4. package/dist/config/config.type.d.cts +3 -0
  5. package/dist/config/config.type.d.ts +3 -0
  6. package/dist/config/config.util.cjs +1 -0
  7. package/dist/config/config.util.d.cts +1 -0
  8. package/dist/config/config.util.d.ts +1 -0
  9. package/dist/config/config.util.js +1 -0
  10. package/dist/config/env/env.constant.d.cts +1 -0
  11. package/dist/config/env/env.constant.d.ts +1 -0
  12. package/dist/config/env/env.type.d.cts +1 -0
  13. package/dist/config/env/env.type.d.ts +1 -0
  14. package/dist/config/env/env.util.d.cts +2 -0
  15. package/dist/config/env/env.util.d.ts +2 -0
  16. package/dist/config/env/index.d.cts +4 -0
  17. package/dist/config/env/index.d.ts +4 -0
  18. package/dist/config/graphql-codegen/graphql-codegen.type.d.cts +1 -0
  19. package/dist/config/graphql-codegen/graphql-codegen.type.d.ts +1 -0
  20. package/dist/config/graphql-codegen/graphql-codegen.util.d.cts +1 -0
  21. package/dist/config/graphql-codegen/graphql-codegen.util.d.ts +1 -0
  22. package/dist/{configs/graphql-codegen/graphql-codegen.util.d.cts → config/graphql-codegen/index.d.cts} +1 -0
  23. package/dist/{configs/graphql-codegen/graphql-codegen.util.d.ts → config/graphql-codegen/index.d.ts} +1 -0
  24. package/dist/config/index.cjs +1 -0
  25. package/dist/config/index.d.cts +13 -0
  26. package/dist/config/index.d.ts +13 -0
  27. package/dist/config/index.js +1 -0
  28. package/dist/constant/common.d.cts +1 -0
  29. package/dist/constant/common.d.ts +1 -0
  30. package/dist/{constants/common.d.cts → constant/index.d.cts} +1 -0
  31. package/dist/{constants/common.d.ts → constant/index.d.ts} +1 -0
  32. package/dist/{constants/index.d.cts → constant/response-status.d.cts} +0 -1
  33. package/dist/{constants/index.d.ts → constant/response-status.d.ts} +0 -1
  34. package/dist/node/apollo-server/apollo-server.type.d.cts +1 -1
  35. package/dist/node/apollo-server/apollo-server.type.d.ts +1 -1
  36. package/dist/node/apollo-server/apollo-server.util.d.cts +2 -2
  37. package/dist/node/apollo-server/apollo-server.util.d.ts +2 -2
  38. package/dist/node/apollo-server/index.d.cts +3 -3
  39. package/dist/node/apollo-server/index.d.ts +3 -3
  40. package/dist/node/cli/cli.util.cjs +1 -1
  41. package/dist/node/cli/cli.util.js +1 -1
  42. package/dist/node/cli/index.cjs +1 -1
  43. package/dist/node/cli/index.js +1 -1
  44. package/dist/node/command/command.type.d.cts +8 -8
  45. package/dist/node/command/command.type.d.ts +8 -8
  46. package/dist/node/command/command.util.cjs +1 -1
  47. package/dist/node/command/command.util.d.cts +6 -6
  48. package/dist/node/command/command.util.d.ts +6 -6
  49. package/dist/node/command/command.util.js +1 -1
  50. package/dist/node/command/index.cjs +1 -1
  51. package/dist/node/command/index.d.cts +14 -14
  52. package/dist/node/command/index.d.ts +14 -14
  53. package/dist/node/command/index.js +1 -1
  54. package/dist/node/express/express.type.d.cts +8 -8
  55. package/dist/node/express/express.type.d.ts +8 -8
  56. package/dist/node/express/express.util.d.cts +7 -7
  57. package/dist/node/express/express.util.d.ts +7 -7
  58. package/dist/node/express/index.d.cts +15 -15
  59. package/dist/node/express/index.d.ts +15 -15
  60. package/dist/node/fs/fs.type.d.cts +1 -1
  61. package/dist/node/fs/fs.type.d.ts +1 -1
  62. package/dist/node/fs/fs.util.d.cts +13 -13
  63. package/dist/node/fs/fs.util.d.ts +13 -13
  64. package/dist/node/fs/index.d.cts +14 -14
  65. package/dist/node/fs/index.d.ts +14 -14
  66. package/dist/node/index.cjs +1 -1
  67. package/dist/node/index.d.cts +176 -176
  68. package/dist/node/index.d.ts +176 -176
  69. package/dist/node/index.js +1 -1
  70. package/dist/node/log/index.cjs +1 -1
  71. package/dist/node/log/index.d.cts +8 -8
  72. package/dist/node/log/index.d.ts +8 -8
  73. package/dist/node/log/index.js +1 -1
  74. package/dist/node/log/log.type.d.cts +5 -5
  75. package/dist/node/log/log.type.d.ts +5 -5
  76. package/dist/node/log/log.util.cjs +1 -1
  77. package/dist/node/log/log.util.d.cts +3 -3
  78. package/dist/node/log/log.util.d.ts +3 -3
  79. package/dist/node/log/log.util.js +1 -1
  80. package/dist/node/mongo/index.cjs +1 -1
  81. package/dist/node/mongo/index.d.cts +61 -61
  82. package/dist/node/mongo/index.d.ts +61 -61
  83. package/dist/node/mongo/index.js +1 -1
  84. package/dist/node/mongo/mongo.constant.d.cts +1 -1
  85. package/dist/node/mongo/mongo.constant.d.ts +1 -1
  86. package/dist/node/mongo/mongo.type.d.cts +55 -55
  87. package/dist/node/mongo/mongo.type.d.ts +55 -55
  88. package/dist/node/mongo/mongo.util.cjs +1 -1
  89. package/dist/node/mongo/mongo.util.d.cts +5 -5
  90. package/dist/node/mongo/mongo.util.d.ts +5 -5
  91. package/dist/node/mongo/mongo.util.js +1 -1
  92. package/dist/node/package/index.cjs +1 -1
  93. package/dist/node/package/index.d.cts +9 -9
  94. package/dist/node/package/index.d.ts +9 -9
  95. package/dist/node/package/index.js +1 -1
  96. package/dist/node/package/package.type.d.cts +4 -4
  97. package/dist/node/package/package.type.d.ts +4 -4
  98. package/dist/node/package/package.util.cjs +1 -1
  99. package/dist/node/package/package.util.d.cts +5 -5
  100. package/dist/node/package/package.util.d.ts +5 -5
  101. package/dist/node/package/package.util.js +1 -1
  102. package/dist/node/path/index.cjs +1 -1
  103. package/dist/node/path/index.d.cts +47 -47
  104. package/dist/node/path/index.d.ts +47 -47
  105. package/dist/node/path/index.js +1 -1
  106. package/dist/node/path/path.constant.cjs +1 -1
  107. package/dist/node/path/path.constant.d.cts +43 -43
  108. package/dist/node/path/path.constant.d.ts +43 -43
  109. package/dist/node/path/path.constant.js +1 -1
  110. package/dist/node/path/path.util.d.cts +4 -4
  111. package/dist/node/path/path.util.d.ts +4 -4
  112. package/dist/node/storage/index.cjs +1 -1
  113. package/dist/node/storage/index.d.cts +1 -1
  114. package/dist/node/storage/index.d.ts +1 -1
  115. package/dist/node/storage/index.js +1 -1
  116. package/dist/node/storage/storage.util.cjs +1 -1
  117. package/dist/node/storage/storage.util.d.cts +1 -1
  118. package/dist/node/storage/storage.util.d.ts +1 -1
  119. package/dist/node/storage/storage.util.js +1 -1
  120. package/dist/node/ws/index.d.cts +4 -4
  121. package/dist/node/ws/index.d.ts +4 -4
  122. package/dist/node/ws/ts.util.d.cts +2 -2
  123. package/dist/node/ws/ts.util.d.ts +2 -2
  124. package/dist/node/ws/ws.type.d.cts +2 -2
  125. package/dist/node/ws/ws.type.d.ts +2 -2
  126. package/dist/react/apollo-client/apollo-client.component.d.cts +1 -1
  127. package/dist/react/apollo-client/apollo-client.component.d.ts +1 -1
  128. package/dist/react/apollo-client/apollo-client.constant.d.cts +1 -1
  129. package/dist/react/apollo-client/apollo-client.constant.d.ts +1 -1
  130. package/dist/react/apollo-client/apollo-client.type.d.cts +5 -5
  131. package/dist/react/apollo-client/apollo-client.type.d.ts +5 -5
  132. package/dist/react/apollo-client/index.d.cts +7 -7
  133. package/dist/react/apollo-client/index.d.ts +7 -7
  134. package/dist/react/apollo-error/apollo-error.component.d.cts +1 -1
  135. package/dist/react/apollo-error/apollo-error.component.d.ts +1 -1
  136. package/dist/react/apollo-error/apollo-error.context.d.cts +1 -1
  137. package/dist/react/apollo-error/apollo-error.context.d.ts +1 -1
  138. package/dist/react/apollo-error/apollo-error.hook.d.cts +1 -1
  139. package/dist/react/apollo-error/apollo-error.hook.d.ts +1 -1
  140. package/dist/react/apollo-error/apollo-error.provider.d.cts +1 -1
  141. package/dist/react/apollo-error/apollo-error.provider.d.ts +1 -1
  142. package/dist/react/apollo-error/apollo-error.type.d.cts +1 -1
  143. package/dist/react/apollo-error/apollo-error.type.d.ts +1 -1
  144. package/dist/react/apollo-error/apollo-error.util.d.cts +2 -2
  145. package/dist/react/apollo-error/apollo-error.util.d.ts +2 -2
  146. package/dist/react/apollo-error/index.d.cts +7 -7
  147. package/dist/react/apollo-error/index.d.ts +7 -7
  148. package/dist/react/apollo-error/index.js +1 -1
  149. package/dist/react/i18next/i18next.hook.d.cts +1 -1
  150. package/dist/react/i18next/i18next.hook.d.ts +1 -1
  151. package/dist/react/i18next/i18next.util.d.cts +1 -1
  152. package/dist/react/i18next/i18next.util.d.ts +1 -1
  153. package/dist/react/i18next/index.d.cts +2 -2
  154. package/dist/react/i18next/index.d.ts +2 -2
  155. package/dist/react/index.cjs +1 -1
  156. package/dist/react/index.d.cts +41 -42
  157. package/dist/react/index.d.ts +41 -42
  158. package/dist/react/index.js +1 -1
  159. package/dist/react/loading/index.d.cts +6 -6
  160. package/dist/react/loading/index.d.ts +6 -6
  161. package/dist/react/loading/loading.component.d.cts +1 -1
  162. package/dist/react/loading/loading.component.d.ts +1 -1
  163. package/dist/react/loading/loading.context.d.cts +1 -1
  164. package/dist/react/loading/loading.context.d.ts +1 -1
  165. package/dist/react/loading/loading.hook.d.cts +1 -1
  166. package/dist/react/loading/loading.hook.d.ts +1 -1
  167. package/dist/react/loading/loading.provider.d.cts +1 -1
  168. package/dist/react/loading/loading.provider.d.ts +1 -1
  169. package/dist/react/loading/loading.type.d.cts +2 -2
  170. package/dist/react/loading/loading.type.d.ts +2 -2
  171. package/dist/react/log/index.d.cts +3 -4
  172. package/dist/react/log/index.d.ts +3 -4
  173. package/dist/react/log/log.type.d.cts +1 -2
  174. package/dist/react/log/log.type.d.ts +1 -2
  175. package/dist/react/log/log.util.d.cts +2 -2
  176. package/dist/react/log/log.util.d.ts +2 -2
  177. package/dist/react/next-intl/index.d.cts +10 -10
  178. package/dist/react/next-intl/index.d.ts +10 -10
  179. package/dist/react/next-intl/next-intl.constant.d.cts +1 -1
  180. package/dist/react/next-intl/next-intl.constant.d.ts +1 -1
  181. package/dist/react/next-intl/next-intl.context.d.cts +1 -1
  182. package/dist/react/next-intl/next-intl.context.d.ts +1 -1
  183. package/dist/react/next-intl/next-intl.hoc.d.cts +1 -1
  184. package/dist/react/next-intl/next-intl.hoc.d.ts +1 -1
  185. package/dist/react/next-intl/next-intl.hook.d.cts +2 -2
  186. package/dist/react/next-intl/next-intl.hook.d.ts +2 -2
  187. package/dist/react/next-intl/next-intl.provider.d.cts +1 -1
  188. package/dist/react/next-intl/next-intl.provider.d.ts +1 -1
  189. package/dist/react/next-intl/next-intl.type.d.cts +4 -4
  190. package/dist/react/next-intl/next-intl.type.d.ts +4 -4
  191. package/dist/react/storage/index.d.cts +2 -2
  192. package/dist/react/storage/index.d.ts +2 -2
  193. package/dist/react/storage/storage.hook.d.cts +1 -1
  194. package/dist/react/storage/storage.hook.d.ts +1 -1
  195. package/dist/react/storage/storage.util.d.cts +1 -1
  196. package/dist/react/storage/storage.util.d.ts +1 -1
  197. package/dist/react/toast/index.d.cts +2 -2
  198. package/dist/react/toast/index.d.ts +2 -2
  199. package/dist/react/vitest/index.cjs +1 -1
  200. package/dist/react/vitest/index.d.cts +2 -2
  201. package/dist/react/vitest/index.d.ts +2 -2
  202. package/dist/react/vitest/index.js +1 -1
  203. package/dist/react/vitest/vitest.e2e.d.cts +1 -1
  204. package/dist/react/vitest/vitest.e2e.d.ts +1 -1
  205. package/dist/react/vitest/vitest.unit.cjs +1 -1
  206. package/dist/react/vitest/vitest.unit.d.cts +1 -1
  207. package/dist/react/vitest/vitest.unit.d.ts +1 -1
  208. package/dist/react/vitest/vitest.unit.js +1 -1
  209. package/dist/typescript/common.d.cts +5 -4
  210. package/dist/typescript/common.d.ts +5 -4
  211. package/dist/typescript/index.d.cts +7 -6
  212. package/dist/typescript/index.d.ts +7 -6
  213. package/dist/typescript/react.d.cts +2 -2
  214. package/dist/typescript/react.d.ts +2 -2
  215. package/dist/util/common/common.util.cjs +1 -0
  216. package/dist/util/common/common.util.d.cts +3 -0
  217. package/dist/util/common/common.util.d.ts +3 -0
  218. package/dist/util/common/common.util.js +1 -0
  219. package/dist/util/common/index.cjs +1 -0
  220. package/dist/{utils/common/common.util.d.cts → util/common/index.d.cts} +1 -0
  221. package/dist/{utils/common/common.util.d.ts → util/common/index.d.ts} +1 -0
  222. package/dist/util/common/index.js +1 -0
  223. package/dist/util/index.cjs +1 -0
  224. package/dist/util/index.d.cts +18 -0
  225. package/dist/util/index.d.ts +18 -0
  226. package/dist/util/index.js +1 -0
  227. package/dist/util/object/index.d.cts +3 -0
  228. package/dist/util/object/index.d.ts +3 -0
  229. package/dist/util/serializer/index.d.cts +5 -0
  230. package/dist/util/serializer/index.d.ts +5 -0
  231. package/dist/{utils/serializer/index.d.cts → util/serializer/serializer.type.d.cts} +0 -1
  232. package/dist/{utils/serializer/index.d.ts → util/serializer/serializer.type.d.ts} +0 -1
  233. package/dist/util/serializer/serializer.util.d.cts +1 -0
  234. package/dist/util/serializer/serializer.util.d.ts +1 -0
  235. package/dist/util/string/index.d.cts +6 -0
  236. package/dist/util/string/index.d.ts +6 -0
  237. package/dist/util/string/string.type.d.cts +1 -0
  238. package/dist/util/string/string.type.d.ts +1 -0
  239. package/dist/{utils/string/index.d.cts → util/string/string.util.d.cts} +0 -1
  240. package/dist/{utils/string/index.d.ts → util/string/string.util.d.ts} +0 -1
  241. package/dist/util/validate/index.d.cts +1 -0
  242. package/dist/util/validate/index.d.ts +1 -0
  243. package/package.json +65 -46
  244. package/public/tsconfig.base.json +1 -1
  245. package/public/wiki/convention.md +1 -1
  246. package/dist/configs/config.type.d.cts +0 -3
  247. package/dist/configs/config.type.d.ts +0 -3
  248. package/dist/configs/config.util.cjs +0 -1
  249. package/dist/configs/config.util.d.cts +0 -1
  250. package/dist/configs/config.util.d.ts +0 -1
  251. package/dist/configs/config.util.js +0 -1
  252. package/dist/configs/env/env.constant.d.cts +0 -1
  253. package/dist/configs/env/env.constant.d.ts +0 -1
  254. package/dist/configs/env/env.type.d.cts +0 -1
  255. package/dist/configs/env/env.type.d.ts +0 -1
  256. package/dist/configs/env/env.util.d.cts +0 -2
  257. package/dist/configs/env/env.util.d.ts +0 -2
  258. package/dist/configs/env/index.d.cts +0 -4
  259. package/dist/configs/env/index.d.ts +0 -4
  260. package/dist/configs/graphql-codegen/graphql-codegen.type.d.cts +0 -1
  261. package/dist/configs/graphql-codegen/graphql-codegen.type.d.ts +0 -1
  262. package/dist/configs/graphql-codegen/index.d.cts +0 -2
  263. package/dist/configs/graphql-codegen/index.d.ts +0 -2
  264. package/dist/configs/index.cjs +0 -1
  265. package/dist/configs/index.d.cts +0 -13
  266. package/dist/configs/index.d.ts +0 -13
  267. package/dist/configs/index.js +0 -1
  268. package/dist/constants/response-status.d.cts +0 -1
  269. package/dist/constants/response-status.d.ts +0 -1
  270. package/dist/index.cjs +0 -1
  271. package/dist/index.d.cts +0 -256
  272. package/dist/index.d.ts +0 -256
  273. package/dist/index.js +0 -1
  274. package/dist/utils/common/common.util.cjs +0 -1
  275. package/dist/utils/common/common.util.js +0 -1
  276. package/dist/utils/common/index.cjs +0 -1
  277. package/dist/utils/common/index.d.cts +0 -2
  278. package/dist/utils/common/index.d.ts +0 -2
  279. package/dist/utils/common/index.js +0 -1
  280. package/dist/utils/index.cjs +0 -1
  281. package/dist/utils/index.d.cts +0 -17
  282. package/dist/utils/index.d.ts +0 -17
  283. package/dist/utils/index.js +0 -1
  284. package/dist/utils/object/object.util.d.cts +0 -3
  285. package/dist/utils/object/object.util.d.ts +0 -3
  286. package/dist/utils/serializer/serializer.type.d.cts +0 -4
  287. package/dist/utils/serializer/serializer.type.d.ts +0 -4
  288. package/dist/utils/serializer/serializer.util.d.cts +0 -1
  289. package/dist/utils/serializer/serializer.util.d.ts +0 -1
  290. package/dist/utils/string/string.type.d.cts +0 -1
  291. package/dist/utils/string/string.type.d.ts +0 -1
  292. package/dist/utils/string/string.util.d.cts +0 -5
  293. package/dist/utils/string/string.util.d.ts +0 -5
  294. package/dist/utils/validate/validate.util.d.cts +0 -1
  295. package/dist/utils/validate/validate.util.d.ts +0 -1
  296. /package/dist/{configs → config}/commitlint/index.cjs +0 -0
  297. /package/dist/{configs → config}/commitlint/index.d.cts +0 -0
  298. /package/dist/{configs → config}/commitlint/index.d.ts +0 -0
  299. /package/dist/{configs → config}/commitlint/index.js +0 -0
  300. /package/dist/{configs → config}/config.type.cjs +0 -0
  301. /package/dist/{configs → config}/config.type.js +0 -0
  302. /package/dist/{configs → config}/env/env.constant.cjs +0 -0
  303. /package/dist/{configs → config}/env/env.constant.js +0 -0
  304. /package/dist/{configs → config}/env/env.type.cjs +0 -0
  305. /package/dist/{configs → config}/env/env.type.js +0 -0
  306. /package/dist/{configs → config}/env/env.util.cjs +0 -0
  307. /package/dist/{configs → config}/env/env.util.js +0 -0
  308. /package/dist/{configs → config}/env/index.cjs +0 -0
  309. /package/dist/{configs → config}/env/index.js +0 -0
  310. /package/dist/{configs → config}/eslint/index.cjs +0 -0
  311. /package/dist/{configs → config}/eslint/index.d.cts +0 -0
  312. /package/dist/{configs → config}/eslint/index.d.ts +0 -0
  313. /package/dist/{configs → config}/eslint/index.js +0 -0
  314. /package/dist/{configs → config}/graphql-codegen/graphql-codegen.type.cjs +0 -0
  315. /package/dist/{configs → config}/graphql-codegen/graphql-codegen.type.js +0 -0
  316. /package/dist/{configs → config}/graphql-codegen/graphql-codegen.util.cjs +0 -0
  317. /package/dist/{configs → config}/graphql-codegen/graphql-codegen.util.js +0 -0
  318. /package/dist/{configs → config}/graphql-codegen/index.cjs +0 -0
  319. /package/dist/{configs → config}/graphql-codegen/index.js +0 -0
  320. /package/dist/{configs → config}/lint-staged/index.cjs +0 -0
  321. /package/dist/{configs → config}/lint-staged/index.d.cts +0 -0
  322. /package/dist/{configs → config}/lint-staged/index.d.ts +0 -0
  323. /package/dist/{configs → config}/lint-staged/index.js +0 -0
  324. /package/dist/{constants → constant}/common.cjs +0 -0
  325. /package/dist/{constants → constant}/common.js +0 -0
  326. /package/dist/{constants → constant}/index.cjs +0 -0
  327. /package/dist/{constants → constant}/index.js +0 -0
  328. /package/dist/{constants → constant}/response-status.cjs +0 -0
  329. /package/dist/{constants → constant}/response-status.js +0 -0
  330. /package/dist/{styles → style}/reset.css +0 -0
  331. /package/dist/{styles → style}/reset.d.cts +0 -0
  332. /package/dist/{styles → style}/reset.d.ts +0 -0
  333. /package/dist/{utils → util}/object/index.cjs +0 -0
  334. /package/dist/{utils → util}/object/index.js +0 -0
  335. /package/dist/{utils → util}/object/object.util.cjs +0 -0
  336. /package/dist/{utils/object/index.d.cts → util/object/object.util.d.cts} +0 -0
  337. /package/dist/{utils/object/index.d.ts → util/object/object.util.d.ts} +0 -0
  338. /package/dist/{utils → util}/object/object.util.js +0 -0
  339. /package/dist/{utils → util}/serializer/index.cjs +0 -0
  340. /package/dist/{utils → util}/serializer/index.js +0 -0
  341. /package/dist/{utils → util}/serializer/serializer.type.cjs +0 -0
  342. /package/dist/{utils → util}/serializer/serializer.type.js +0 -0
  343. /package/dist/{utils → util}/serializer/serializer.util.cjs +0 -0
  344. /package/dist/{utils → util}/serializer/serializer.util.js +0 -0
  345. /package/dist/{utils → util}/string/index.cjs +0 -0
  346. /package/dist/{utils → util}/string/index.js +0 -0
  347. /package/dist/{utils → util}/string/string.type.cjs +0 -0
  348. /package/dist/{utils → util}/string/string.type.js +0 -0
  349. /package/dist/{utils → util}/string/string.util.cjs +0 -0
  350. /package/dist/{utils → util}/string/string.util.js +0 -0
  351. /package/dist/{utils → util}/validate/index.cjs +0 -0
  352. /package/dist/{utils → util}/validate/index.js +0 -0
  353. /package/dist/{utils → util}/validate/validate.util.cjs +0 -0
  354. /package/dist/{utils/validate/index.d.cts → util/validate/validate.util.d.cts} +0 -0
  355. /package/dist/{utils/validate/index.d.ts → util/validate/validate.util.d.ts} +0 -0
  356. /package/dist/{utils → util}/validate/validate.util.js +0 -0
@@ -1 +1 @@
1
- "use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t,n,r,s,i,o){try{var a=e[i](o);var c=a.value}catch(e){n(e);return}if(a.done){t(c)}else{Promise.resolve(c).then(r,s)}}function s(e){return function(){var t=this,n=arguments;return new Promise(function(s,i){var o=e.apply(t,n);function a(e){r(o,s,i,a,c,"next",e)}function c(e){r(o,s,i,a,c,"throw",e)}a(undefined)})}}function i(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function o(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function a(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var s=true;var i=false;var o,a;try{for(n=n.call(e);!(s=(o=n.next()).done);s=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;a=e}finally{try{if(!s&&n["return"]!=null)n["return"]()}finally{if(i)throw a}}return r}function u(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){i(e,t,n[t])})}return e}function p(e,n){return t(e)||c(e,n)||m(e,n)||u()}function E(e){return n(e)||a(e)||m(e)||l()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function m(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function g(e,t){var n,r,s,i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=a(0),o["throw"]=a(1),o["return"]=a(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return c([e,t])}}function c(a){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(i=0)),i)try{if(n=1,r&&(s=a[0]&2?r["return"]:a[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;if(r=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;r=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(a[0]===6&&i.label<s[1]){i.label=s[1];s=a;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(a);break}if(s[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];r=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}var y=Object.create;var v=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var C=function(e,t){return v(e,"name",{value:t,configurable:!0})};var I=function(e,t,n,r){var s=true,i=false,o=undefined;if(t&&(typeof t==="undefined"?"undefined":f(t))=="object"||typeof t=="function")try{var a=function(){var s=u.value;!O.call(e,s)&&s!==n&&v(e,s,{get:function(){return t[s]},enumerable:!(r=h(t,s))||r.enumerable})};for(var c=S(t)[Symbol.iterator](),u;!(s=(u=c.next()).done);s=true)a()}catch(e){i=true;o=e}finally{try{if(!s&&c.return!=null){c.return()}}finally{if(i){throw o}}}return e};var N=function(e,t,n){return n=e!=null?y(D(e)):{},I(t||!e||!e.__esModule?v(n,"default",{value:e,enumerable:!0}):n,e)},T=function(e){return I(v({},"__esModule",{value:!0}),e)};var x={};module.exports=T(x);var A=N(require("process"),1),_=require("yargs/helpers"),R=N(require("yargs/yargs"),1);var b={name:"@cyberskill/shared",type:"module",version:"1.137.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./configs":{types:"./dist/configs/index.d.ts",import:"./dist/configs/index.js",require:"./dist/configs/index.cjs"},"./configs/commitlint":{types:"./dist/configs/commitlint/index.d.ts",import:"./dist/configs/commitlint/index.js",require:"./dist/configs/commitlint/index.cjs"},"./configs/env":{types:"./dist/configs/env/index.d.ts",import:"./dist/configs/env/index.js",require:"./dist/configs/env/index.cjs"},"./configs/eslint":{types:"./dist/configs/eslint/index.d.ts",import:"./dist/configs/eslint/index.js",require:"./dist/configs/eslint/index.cjs"},"./configs/graphql-codegen":{types:"./dist/configs/graphql-codegen/index.d.ts",import:"./dist/configs/graphql-codegen/index.js",require:"./dist/configs/graphql-codegen/index.cjs"},"./configs/lint-staged":{types:"./dist/configs/lint-staged/index.d.ts",import:"./dist/configs/lint-staged/index.js",require:"./dist/configs/lint-staged/index.cjs"},"./constants":{types:"./dist/constants/index.d.ts",import:"./dist/constants/index.js",require:"./dist/constants/index.cjs"},"./node":{types:"./dist/node/index.d.ts",import:"./dist/node/index.js",require:"./dist/node/index.cjs"},"./node/apollo-server":{types:"./dist/node/apollo-server/index.d.ts",import:"./dist/node/apollo-server/index.js",require:"./dist/node/apollo-server/index.cjs"},"./node/cli":{types:"./dist/node/cli/index.d.ts",import:"./dist/node/cli/index.js",require:"./dist/node/cli/index.cjs"},"./node/command":{types:"./dist/node/command/index.d.ts",import:"./dist/node/command/index.js",require:"./dist/node/command/index.cjs"},"./node/express":{types:"./dist/node/express/index.d.ts",import:"./dist/node/express/index.js",require:"./dist/node/express/index.cjs"},"./node/fs":{types:"./dist/node/fs/index.d.ts",import:"./dist/node/fs/index.js",require:"./dist/node/fs/index.cjs"},"./node/log":{types:"./dist/node/log/index.d.ts",import:"./dist/node/log/index.js",require:"./dist/node/log/index.cjs"},"./node/mongo":{types:"./dist/node/mongo/index.d.ts",import:"./dist/node/mongo/index.js",require:"./dist/node/mongo/index.cjs"},"./node/package":{types:"./dist/node/package/index.d.ts",import:"./dist/node/package/index.js",require:"./dist/node/package/index.cjs"},"./node/path":{types:"./dist/node/path/index.d.ts",import:"./dist/node/path/index.js",require:"./dist/node/path/index.cjs"},"./node/storage":{types:"./dist/node/storage/index.d.ts",import:"./dist/node/storage/index.js",require:"./dist/node/storage/index.cjs"},"./node/ws":{types:"./dist/node/ws/index.d.ts",import:"./dist/node/ws/index.js",require:"./dist/node/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./styles/reset.css":{import:"./dist/styles/reset.css",require:"./dist/styles/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./utils":{types:"./dist/utils/index.d.ts",import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"}},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{cyberskill:"dist/node/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"tsup --watch",lint:"tsx src/node/cli/index.ts lint","lint:fix":"tsx src/node/cli/index.ts lint:fix","lint:inspect":"tsx src/node/cli/index.ts lint:inspect",reset:"tsx src/node/cli/index.ts reset",prepare:"tsx src/node/cli/index.ts prepare",inspect:"tsx src/node/cli/index.ts inspect","test:unit":"tsx src/node/cli/index.ts test:unit","test:e2e":"tsx src/node/cli/index.ts test:e2e",commitlint:"tsx src/node/cli/index.ts commitlint"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@dotenvx/dotenvx":"1.42.2","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.5","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.7","@nestjs/common":"11.1.0","@nestjs/core":"11.1.0","@next/eslint-plugin-next":"15.3.1","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.9.0","@vitest/browser":"3.1.2","body-parser":"2.2.0",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2","cookie-parser":"1.4.7",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0","dotenv-cli":"8.0.0",envalid:"8.0.0","eslint-config-next":"15.3.1","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20",express:"4.21.2","express-session":"1.18.1","express-useragent":"1.0.15","fs-extra":"11.3.0",globals:"16.0.0",graphql:"16.11.0","graphql-ws":"6.0.4",i18next:"25.0.2",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3","modern-normalize":"3.0.1",mongodb:"6.16.0",mongoose:"8.14.1","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.1.0","node-fetch":"3.3.2","node-persist":"4.0.4",playwright:"1.52.0","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.5.1","react-icons":"5.5.0",sass:"1.87.0",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.4",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.4",vitest:"3.1.2","vitest-browser-react":"0.1.1",ws:"8.18.1",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@commitlint/config-conventional":"19.8.0","@eslint/config-inspector":"1.0.2","@types/body-parser":"1.19.5","@types/compression":"1.7.5","@types/cookie-parser":"1.4.8","@types/cors":"2.8.17","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.1","@types/express-useragent":"1.0.5","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node":"22.15.3","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.3","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.26.0","lint-staged":"15.5.1","node-modules-inspector":"0.6.7","simple-git-hooks":"2.13.0"}};var G=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});var P=require("child_process"),M=N(require("process"),1),w=N(require("util"),1);var j=".cyberskill-storage";var L=N(require("@dotenvx/dotenvx"),1),k=require("envalid"),U=N(require("os"),1),q=N(require("path"),1),F=N(require("process"),1);var Y=!1;function V(){Y||(L.default.config(),Y=!0)}C(V,"loadEnvFile");function B(){V();var e=(0,k.cleanEnv)(F.default.env,{CWD:(0,k.str)({default:F.default.cwd()}),DEBUG:(0,k.bool)({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:(0,k.str)({default:q.default.join(U.default.homedir(),j)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}C(B,"getEnv");var K=function(e){return e.Error="error",e.Warning="warning",e}({});var H=N(require("chalk"),1),Q=N(require("consola"),1),W=require("graphql");var J={GRAPHQL_PARSE_FAILED:{CODE:"GRAPHQL_PARSE_FAILED",MESSAGE:"The GraphQL operation string contains a syntax error."},GRAPHQL_VALIDATION_FAILED:{CODE:"GRAPHQL_VALIDATION_FAILED",MESSAGE:"The GraphQL operation is not valid against the server's schema."},BAD_USER_INPUT:{CODE:"BAD_USER_INPUT",MESSAGE:"The GraphQL operation includes an invalid value for a field argument."},PERSISTED_QUERY_NOT_FOUND:{CODE:"PERSISTED_QUERY_NOT_FOUND",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the query was not in the APQ cache."},PERSISTED_QUERY_NOT_SUPPORTED:{CODE:"PERSISTED_QUERY_NOT_SUPPORTED",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the server has disabled APQ."},OPERATION_RESOLUTION_FAILURE:{CODE:"OPERATION_RESOLUTION_FAILURE",MESSAGE:"The request was parsed successfully and is valid against the server's schema, but the server couldn't resolve which operation to run. This occurs when a request containing multiple named operations doesn't specify which operation to run (i.e.,operationName), or if the named operation isn't included in the request."},CONTINUE:{CODE:100,MESSAGE:"Continue"},SWITCHING_PROTOCOLS:{CODE:101,MESSAGE:"Switching Protocols"},PROCESSING:{CODE:102,MESSAGE:"Processing"},OK:{CODE:200,MESSAGE:"OK"},CREATED:{CODE:201,MESSAGE:"Created"},ACCEPTED:{CODE:202,MESSAGE:"Accepted"},NON_AUTHORITATIVE_INFORMATION:{CODE:203,MESSAGE:"Non Authoritative Information"},NO_CONTENT:{CODE:204,MESSAGE:"No Content"},RESET_CONTENT:{CODE:205,MESSAGE:"Reset Content"},PARTIAL_CONTENT:{CODE:206,MESSAGE:"Partial Content"},MULTI_STATUS:{CODE:207,MESSAGE:"Multi-Status"},MULTIPLE_CHOICES:{CODE:300,MESSAGE:"Multiple Choices"},MOVED_PERMANENTLY:{CODE:301,MESSAGE:"Moved Permanently"},MOVED_TEMPORARILY:{CODE:302,MESSAGE:"Moved Temporarily"},SEE_OTHER:{CODE:303,MESSAGE:"See Other"},NOT_MODIFIED:{CODE:304,MESSAGE:"Not Modified"},USE_PROXY:{CODE:305,MESSAGE:"Use Proxy"},TEMPORARY_REDIRECT:{CODE:307,MESSAGE:"Temporary Redirect"},PERMANENT_REDIRECT:{CODE:308,MESSAGE:"Permanent Redirect"},BAD_REQUEST:{CODE:400,MESSAGE:"Bad Request"},UNAUTHORIZED:{CODE:401,MESSAGE:"Unauthorized"},PAYMENT_REQUIRED:{CODE:402,MESSAGE:"Payment Required"},FORBIDDEN:{CODE:403,MESSAGE:"Forbidden"},NOT_FOUND:{CODE:404,MESSAGE:"Not Found"},METHOD_NOT_ALLOWED:{CODE:405,MESSAGE:"Method Not Allowed"},NOT_ACCEPTABLE:{CODE:406,MESSAGE:"Not Acceptable"},PROXY_AUTHENTICATION_REQUIRED:{CODE:407,MESSAGE:"Proxy Authentication Required"},REQUEST_TIMEOUT:{CODE:408,MESSAGE:"Request Timeout"},CONFLICT:{CODE:409,MESSAGE:"Conflict"},GONE:{CODE:410,MESSAGE:"Gone"},LENGTH_REQUIRED:{CODE:411,MESSAGE:"Length Required"},PRECONDITION_FAILED:{CODE:412,MESSAGE:"Precondition Failed"},REQUEST_TOO_LONG:{CODE:413,MESSAGE:"Request Entity Too Large"},REQUEST_URI_TOO_LONG:{CODE:414,MESSAGE:"Request-URI Too Long"},UNSUPPORTED_MEDIA_TYPE:{CODE:415,MESSAGE:"Unsupported Media Type"},REQUESTED_RANGE_NOT_SATISFIABLE:{CODE:416,MESSAGE:"Requested Range Not Satisfiable"},EXPECTATION_FAILED:{CODE:417,MESSAGE:"Expectation Failed"},IM_A_TEAPOT:{CODE:418,MESSAGE:"I'm a teapot"},INSUFFICIENT_SPACE_ON_RESOURCE:{CODE:419,MESSAGE:"Insufficient Space on Resource"},METHOD_FAILURE:{CODE:420,MESSAGE:"Method Failure"},MISDIRECTED_REQUEST:{CODE:421,MESSAGE:"Misdirected Request"},UNPROCESSABLE_ENTITY:{CODE:422,MESSAGE:"Unprocessable Entity"},LOCKED:{CODE:423,MESSAGE:"Locked"},FAILED_DEPENDENCY:{CODE:424,MESSAGE:"Failed Dependency"},PRECONDITION_REQUIRED:{CODE:428,MESSAGE:"Precondition Required"},TOO_MANY_REQUESTS:{CODE:429,MESSAGE:"Too Many Requests"},REQUEST_HEADER_FIELDS_TOO_LARGE:{CODE:431,MESSAGE:"Request Header Fields Too Large"},UNAVAILABLE_FOR_LEGAL_REASONS:{CODE:451,MESSAGE:"Unavailable For Legal Reasons"},INTERNAL_SERVER_ERROR:{CODE:500,MESSAGE:"Internal Server Error"},NOT_IMPLEMENTED:{CODE:501,MESSAGE:"Not Implemented"},BAD_GATEWAY:{CODE:502,MESSAGE:"Bad Gateway"},SERVICE_UNAVAILABLE:{CODE:503,MESSAGE:"Service Unavailable"},GATEWAY_TIMEOUT:{CODE:504,MESSAGE:"Gateway Timeout"},HTTP_VERSION_NOT_SUPPORTED:{CODE:505,MESSAGE:"HTTP Version Not Supported"},INSUFFICIENT_STORAGE:{CODE:507,MESSAGE:"Insufficient Storage"},NETWORK_AUTHENTICATION_REQUIRED:{CODE:511,MESSAGE:"Network Authentication Required"}};var z=B();z.DEBUG||(Q.default.level=4);function $(e){var t=H.default[e];return typeof t=="function"?t:H.default.green}C($,"chalkKeyword");var X={silent:Q.default.silent,level:Q.default.level,fatal:Q.default.fatal,error:Q.default.error,warn:Q.default.warn,log:Q.default.log,info:Q.default.info,success:Q.default.success,ready:Q.default.ready,start:Q.default.start,box:Q.default.box,debug:Q.default.debug,trace:Q.default.trace,verbose:Q.default.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){Q.default.box(H.default.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;Q.default.log("".concat(H.default.gray("File:")," ").concat(H.default.blue("".concat(t).concat(r?":".concat(r):"")))),s&&Q.default.log(" ".concat($(n)("Rule:")," ").concat(s)),Q.default.log(" ".concat($(n)("Message:")," ").concat(i))}),Q.default.box($(n)("".concat(e," : ").concat(t.length))),Q.default.log(H.default.gray("─".repeat(40)))}};function Z(e,t){var n=t!==null&&t!==void 0?t:{},r=n.shouldLog,s=r===void 0?!0:r,i=n.returnValue,a=n.callback,c=o(e,Error)?e:new Error(typeof e=="string"?e:"Unknown error");return s&&X.error(c.message),a&&typeof a=="function"&&a(c),i||{success:!1,message:c.message,code:J.INTERNAL_SERVER_ERROR.CODE}}C(Z,"catchErrorNode");var ee=function(e){return e.DEPENDENCY="dependencies",e.DEV_DEPENDENCY="devDependencies",e.PEER_DEPENDENCY="peerDependencies",e.BUNDLE_DEPENDENCY="bundleDependencies",e.OPTIONAL_DEPENDENCY="optionalDependencies",e}({});var et=N(require("node-fetch"),1);var en=N(require("fs-extra"),1),er=N(require("path"),1);var es=en.default,ei=es.lstatSync,eo=es.readdirSync,ea=es.mkdirSync,ec=es.readFileSync,eu=es.unlinkSync,el=es.statSync,ed=en.default.readJsonSync;function ep(e,t,n){en.default.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}C(ep,"writeFileSync");function eE(e,t,n){en.default.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}C(eE,"appendFileSync");function ef(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return en.default.pathExistsSync(e)})}C(ef,"pathExistsSync");function em(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){ef(e)&&en.default.removeSync(e)})}C(em,"removeSync");var eg=N(require("fs-extra"),1);var ey=N(require("path"),1);var ev=B(),eh=ey.default;function eS(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=eh).resolve.apply(r,[ev.CWD].concat(E(t)))}C(eS,"resolveWorkingPath");function eD(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=eh).join.apply(r,E(t))}C(eD,"join");var eO=B(),eC=eO.CWD,eI="@cyberskill/shared",eN="node_modules",eT="dist",ex="package.json",eA="package-lock.json",e_="tsconfig.json",eR=".gitignore",eb=".simple-git-hooks.json",eG="pnpm-lock.yaml",eP=".git/hooks/",eM=".git/COMMIT_EDITMSG",ew=".migrate-mongo.config.js",ej=function(){var e=eg.default.readJsonSync(eS(ex)).name===eI?eC:eD(eC,eN,eI);return eD(e,eT)}(),eL="cyberskill",ek="src/node/cli/index.ts",eU="eslint",eq="eslint",eF="vitest";var eY="vitest",eV="@commitlint/cli",eB="@commitlint/config-conventional",eK="commitlint",eH="lint-staged",eQ="lint-staged",eW="typescript",eJ="tsc",ez="tsx",e$="git",eX="pnpm",eZ="pnpm exec",e0="simple-git-hooks",e1="simple-git-hooks",e2="@eslint/config-inspector",e4="eslint-config-inspector",e3="node-modules-inspector",e5="node-modules-inspector",e8="migrate-mongo",e6="./node_modules/migrate-mongo/bin/migrate-mongo",e7={CYBERSKILL_DIRECTORY:ej,WORKING_DIRECTORY:eC,TS_CONFIG:eS(e_),GIT_IGNORE:eS(eR),GIT_HOOK:eS(eP),GIT_COMMIT_MSG:eS(eM),SIMPLE_GIT_HOOKS_JSON:eS(eb),PACKAGE_JSON:eS(ex),PACKAGE_LOCK_JSON:eS(eA),PNPM_LOCK_YAML:eS(eG),NODE_MODULES:eS(eN),MIGRATE_MONGO_CONFIG:eS(ew),LINT_STAGED_CONFIG:eS("".concat(ej,"/configs/lint-staged/index.js")),COMMITLINT_CONFIG:eS("".concat(ej,"/configs/commitlint/index.js")),UNIT_TEST_CONFIG:eS("".concat(ej,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:eS("".concat(ej,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:eS("".concat(ej,"/react/vitest/vitest.e2e.js"))};function e9(e){var t=e.isCurrentProject;return d({"pre-commit":eQ,"commit-msg":eK},t&&{"pre-push":tD("".concat(e$," pull"))})}C(e9,"createGitHooksConfig");function te(e){var t=e.type,n=e.packages,r=e.command;var i=n===null||n===void 0?void 0:n.reduce(function(e,t){return e.some(function(e){return e.name===t.name})||e.push(t),e},[]);return function(){return s(function(){var e;return g(this,function(n){switch(n.label){case 0:switch(t){case G.CLI:return[3,1];case G.STRING:return[3,4]}return[3,5];case 1:e=i===null||i===void 0?void 0:i.length;if(!e)return[3,3];return[4,ta(i,{update:!0})];case 2:e=n.sent();n.label=3;case 3:return[2,(e,tC(tD("".concat(eZ," ").concat(r))))];case 4:return[2,tC(tD(r))];case 5:throw new Error("Unsupported command type");case 6:return[2]}})})()}}C(te,"buildCommand");var tt={simpleGitHooks:te({type:G.CLI,packages:[{name:e0,type:ee.DEV_DEPENDENCY}],command:e1}),eslintInspect:te({type:G.CLI,packages:[{name:e2,type:ee.DEV_DEPENDENCY}],command:e4}),nodeModulesInspect:te({type:G.CLI,packages:[{name:e3,type:ee.DEV_DEPENDENCY}],command:e5}),eslintCheck:te({type:G.CLI,packages:[{name:eU,type:ee.DEV_DEPENDENCY}],command:"".concat(eq," ").concat(e7.WORKING_DIRECTORY," --no-cache")}),eslintFix:te({type:G.CLI,packages:[{name:eU,type:ee.DEV_DEPENDENCY}],command:"".concat(eq," ").concat(e7.WORKING_DIRECTORY," --fix --no-cache")}),typescriptCheck:te({type:G.CLI,packages:[{name:eW,type:ee.DEPENDENCY}],command:"".concat(eJ," -p ").concat(e7.TS_CONFIG," --noEmit")}),testUnit:te({type:G.CLI,packages:[{name:eF,type:ee.DEV_DEPENDENCY}],command:"".concat(eY," --config ").concat(e7.UNIT_TEST_CONFIG)}),testE2e:te({type:G.CLI,packages:[{name:eF,type:ee.DEV_DEPENDENCY}],command:"".concat(eY," --config ").concat(e7.E2E_TEST_CONFIG)}),mongoMigrateCreate:C(function(e){return te({type:G.CLI,packages:[{name:e8,type:ee.DEPENDENCY}],command:"".concat(ez," ").concat(e6," create ").concat(e," -f ").concat(e7.MIGRATE_MONGO_CONFIG)})()},"mongoMigrateCreate"),mongoMigrateUp:te({type:G.CLI,packages:[{name:e8,type:ee.DEPENDENCY}],command:"".concat(ez," ").concat(e6," up -f ").concat(e7.MIGRATE_MONGO_CONFIG)}),mongoMigrateDown:te({type:G.CLI,packages:[{name:e8,type:ee.DEPENDENCY}],command:"".concat(ez," ").concat(e6," down -f ").concat(e7.MIGRATE_MONGO_CONFIG)}),commitLint:te({type:G.CLI,packages:[{name:eV,type:ee.DEV_DEPENDENCY},{name:eB,type:ee.DEV_DEPENDENCY}],command:"".concat(eK," --edit ").concat(e7.GIT_COMMIT_MSG," --config ").concat(e7.COMMITLINT_CONFIG)}),lintStaged:te({type:G.CLI,packages:[{name:eH,type:ee.DEV_DEPENDENCY}],command:"".concat(eQ," --config ").concat(e7.LINT_STAGED_CONFIG)}),configureGitHook:te({type:G.STRING,command:"".concat(e$," config core.hooksPath ").concat(e7.GIT_HOOK)}),stageBuildDirectory:te({type:G.STRING,command:"".concat(e$," add ").concat(eT)}),build:te({type:G.STRING,command:"".concat(eX," run --if-present build")}),pnpmInstallStandard:te({type:G.STRING,command:"".concat(eX," install --no-frozen-lockfile")}),pnpmInstallLegacy:te({type:G.STRING,command:"".concat(eX," install --no-frozen-lockfile --legacy-peer-deps")}),pnpmInstallForce:te({type:G.STRING,command:"".concat(eX," install --no-frozen-lockfile --force")})};var tn=B();function tr(e){return s(function(){var t,n,r,s;return g(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,(0,et.default)("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=i.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=i.sent(),r=n.version;return[2,{success:!0,result:r}];case 3:s=i.sent();return[2,Z(s)];case 4:return[2]}})})()}C(tr,"getLatestPackageVersion");function ts(e){return s(function(){var t,n,r,s,i,o,a,c,u,l,d,p,E,f,m,y,v,h,S;return g(this,function(g){switch(g.label){case 0:g.trys.push([0,2,,3]);if(!ef(e7.PACKAGE_JSON))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===ee.DEPENDENCY,isDevDependency:e.type===ee.DEV_DEPENDENCY,installedPath:"",file:{}}}];t=ed(e7.PACKAGE_JSON),n=t.name,r=t.version,s=r===void 0?"":r,i=t.dependencies,o=i===void 0?{}:i,a=t.devDependencies,c=a===void 0?{}:a;if(e.name===n)return[2,{success:!0,result:{name:n,currentVersion:s,latestVersion:s,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:e.type===ee.DEPENDENCY,isDevDependency:e.type===ee.DEV_DEPENDENCY,installedPath:e7.PACKAGE_JSON,file:t}}];u=e.name in o,l=e.name in c;return[4,tr(e.name)];case 1:d=g.sent();if(!d.success)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:u,isDevDependency:l,installedPath:"",file:{}}}];if(!u&&!l)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:d.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===ee.DEPENDENCY,isDevDependency:e.type===ee.DEV_DEPENDENCY,installedPath:"",file:{}}}];f=(E=(p=o[e.name])!==null&&p!==void 0?p:c[e.name])!==null&&E!==void 0?E:"",m=eD(tn.CWD,eN,e.name,ex);if(!ef(m))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:d.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:u,isDevDependency:l,installedPath:"",file:{}}}];y=ed(m),v=y.version,h=v===void 0?"":v;return[2,f!==h?{success:!0,result:{name:e.name,currentVersion:h||f,latestVersion:d.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:!1,isDependency:u,isDevDependency:l,installedPath:m,file:y}}:{success:!0,result:{name:e.name,currentVersion:f,latestVersion:d.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:f===d.result,isDependency:u,isDevDependency:l,installedPath:m,file:y}}];case 2:S=g.sent();return[2,Z(S)];case 3:return[2]}})})()}C(ts,"getPackage");function ti(e){return s(function(){var t,n,r,s,i;return g(this,function(o){try{;r=ed(e7.PACKAGE_JSON),s=(t=r.dependencies)!==null&&t!==void 0?t:{},i=(n=r.devDependencies)!==null&&n!==void 0?n:{};e.isDependency?s[e.name]=e.latestVersion:e.isDevDependency&&(i[e.name]=e.latestVersion),ep(e7.PACKAGE_JSON,JSON.stringify(r,null,4)),X.info('Updated "'.concat(e.name,'" to version ').concat(e.latestVersion))}catch(e){Z(e)}return[2]})})()}C(ti,"updatePackage");function to(){return s(function(){var e,t,n,r,s,i,o,a,c,u,l,d,p;return g(this,function(E){switch(E.label){case 0:E.trys.push([0,12,,13]);e=[{command:C(function(){return tt.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:C(function(){return tt.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:C(function(){return tt.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;E.label=1;case 1:E.trys.push([1,9,10,11]);s=e[Symbol.iterator]();E.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,8];o=i.value,a=o.command,c=o.message;E.label=3;case 3:E.trys.push([3,6,,7]);return[4,a()];case 4:u=E.sent();return[4,tN("".concat(c," using: ").concat(u),u)];case 5:E.sent();return[2];case 6:l=E.sent();Z(l);return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=E.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}return[7];case 11:return[3,13];case 12:p=E.sent();Z(p);return[3,13];case 13:return[2]}})})()}C(to,"installDependencies");function ta(e,t){return s(function(){var n,r,s,i,o,a,c,u,l,d,p,E;return g(this,function(f){switch(f.label){case 0:if(!ef(e7.PACKAGE_JSON)){X.error("package.json not found. Aborting setup.");return[2]}f.label=1;case 1:f.trys.push([1,16,,17]);return[4,Promise.all(e.map(ts))];case 2:n=f.sent().filter(function(e){return e.success?!e.result.isCurrentProject&&(!e.result.isInstalled||!e.result.isUpToDate):!1});r=n.length>0;if(!r)return[3,7];return[4,Promise.all(n.map(function(e){return e.success?ti(e.result):Promise.resolve()}))];case 3:f.sent();return[4,to()];case 4:f.sent();s=["Running ESLint with auto-fix"];return[4,tt.eslintFix()];case 5:return[4,tN.apply(void 0,s.concat([f.sent()]))];case 6:r=f.sent();f.label=7;case 7:r;o=true,a=false,c=undefined;f.label=8;case 8:f.trys.push([8,13,14,15]);u=((i=t===null||t===void 0?void 0:t.postInstallActions)!==null&&i!==void 0?i:[])[Symbol.iterator]();f.label=9;case 9:if(!!(o=(l=u.next()).done))return[3,12];d=l.value;return[4,d()];case 10:f.sent();f.label=11;case 11:o=true;return[3,9];case 12:return[3,15];case 13:p=f.sent();a=true;c=p;return[3,15];case 14:try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw c}}return[7];case 15:return[3,17];case 16:E=f.sent();Z(E);return[3,17];case 17:return[2]}})})()}C(ta,"setupPackages");var tc=N(require("node-persist"),1);var tu=B();function tl(){return s(function(){var e;return g(this,function(t){switch(t.label){case 0:e=tc.default.defaultInstance;if(e)return[3,2];return[4,tc.default.init({dir:tu.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}C(tl,"initNodePersist");var td={get:function e(e){return s(function(){var t,n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tl()];case 1:r.sent();return[4,tc.default.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,Z(n,{returnValue:null})];case 4:return[2]}})})()},set:function e(e,t){return s(function(){var n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tl()];case 1:r.sent();return[4,tc.default.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();Z(n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return s(function(){var t;return g(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tl()];case 1:n.sent();return[4,tc.default.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();Z(t);return[3,4];case 4:return[2]}})})()},keys:function e(){return s(function(){var e,t;return g(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tl()];case 1:n.sent();return[4,tc.default.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(X.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,Z(t,{returnValue:[]})];case 4:return[2]}})})()},getLogLink:function e(e){return s(function(){return g(this,function(t){try{return[2,"".concat(tu.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,Z(e,{returnValue:null})]}return[2]})})()}};var tp=B(),tE=w.promisify(P.exec);function tf(e){return"error_list:".concat(e)}C(tf,"getErrorListKey");function tm(e){return s(function(){var t,n,r;return g(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];t=Date.now(),n=tf(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,td.set(n,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(function(){return s(function(){var e;return g(this,function(t){switch(t.label){case 0:return[4,td.getLogLink(n)];case 1:e=t.sent();e&&X.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},10);return[3,4];case 3:r=i.sent();Z(r);return[3,4];case 4:return[2]}})})()}C(tm,"saveErrorListToStorage");function tg(){return s(function(){var e,t,n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,td.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return s(function(){var t;return g(this,function(n){switch(n.label){case 0:return[4,td.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})})()}))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,Z(n,{returnValue:[]})];case 4:return[2]}})})()}C(tg,"getStoredErrorLists");function ty(){return s(function(){var e,t,n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,td.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return td.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();Z(n);return[3,4];case 4:return[2]}})})()}C(ty,"clearAllErrorLists");function tv(e){var t=[],n=[],r="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var a,c,u,l,d;var p=s.exec(e)||[],E=i.exec(e)||[],f=o.exec(e)||[];var m,g,y,v,h,S;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===K.Error?K.Error:K.Warning,message:(m=p===null||p===void 0?void 0:(a=p[4])===null||a===void 0?void 0:a.trim())!==null&&m!==void 0?m:"",rule:(g=p===null||p===void 0?void 0:(c=p[5])===null||c===void 0?void 0:c.trim())!==null&&g!==void 0?g:""}):E.length?t.push({file:(y=E===null||E===void 0?void 0:E[1])!==null&&y!==void 0?y:"",position:"".concat(E[2],":").concat(E[3]),type:E[4]===K.Error?K.Error:K.Warning,message:(v=E===null||E===void 0?void 0:(u=E[5])===null||u===void 0?void 0:u.trim())!==null&&v!==void 0?v:""}):f.length?t.push({file:"commitlint",type:K.Error,message:(h=f===null||f===void 0?void 0:(l=f[1])===null||l===void 0?void 0:l.trim())!==null&&h!==void 0?h:"",rule:(S=f===null||f===void 0?void 0:(d=f[2])===null||d===void 0?void 0:d.trim())!==null&&S!==void 0?S:""}):n.push(e.trim())}}),t.length&&tm(t),tp.DEBUG&&n.length&&(X.warn("Unmatched lines:"),n.forEach(function(e){return X.info(" ".concat(e))}))}C(tv,"parseTextErrors");function th(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,s=e.line,i=e.column,o=e.ruleId,a=e.message;n.push({type:r===2?K.Error:K.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:a})})}),n.length&&tm(n)}catch(t){tv(e)}}C(th,"parseCommandOutput");function tS(e){return s(function(e){var t,n,r,s,i,o,a,c,u;var l=arguments;return g(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:th;n=new AbortController;M.default.on("SIGINT",function(){X.warn("Process interrupted. Terminating..."),n.abort(),M.default.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,tE(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),s=r.stdout,i=r.stderr;[s,i].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:o=d.sent();a=o.stdout,c=o.stderr,u=o.message;[a,c].forEach(function(e){return e&&t(e)}),!c&&!a&&X.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}C(tS,"executeCommand");function tD(e){return{raw:!0,cmd:e}}C(tD,"rawCommand");function tO(e,t){return(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eZ," ").concat(ez," ").concat(ek," ").concat(e):"".concat(eZ," ").concat(eL," ").concat(e)}C(tO,"formatCLI");function tC(e,t){return typeof e=="function"?tO(e(t),t):(typeof e==="undefined"?"undefined":f(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tO(e,t):e}C(tC,"formatCommand");function tI(e){return s(function(){var t,n,r;return g(this,function(s){switch(s.label){case 0:return[4,ts({name:eI})];case 1:t=s.sent();if(t.success){n={isCurrentProject:t.result.isCurrentProject},r=typeof e=="function"?e(n):e;return[2,Object.fromEntries(Object.entries(r).map(function(e){var t=p(e,2),r=t[0],s=t[1];return[r,tC(s,n)]}))]}return[2]}})})()}C(tI,"resolveCommands");function tN(e,t){return s(function(){var n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);X.start("".concat(e)),tp.DEBUG&&X.info("→ ".concat(t));return[4,tS(t)];case 1:r.sent(),X.success("".concat(e," done."));return[3,3];case 2:n=r.sent();Z(n);return[3,3];case 3:return[2]}})})()}C(tN,"runCommand");function tT(){return s(function(){var e,t;return g(this,function(n){switch(n.label){case 0:if(!ef(e7.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,tt.typescriptCheck()];case 1:return[4,tN.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=X.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}C(tT,"checkTypescript");function tx(){return s(function(){var e,t,n,r;var s=arguments;return g(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,tt.eslintFix()];case 1:return[4,tN.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,tt.eslintCheck()];case 4:return[4,tN.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})}).apply(this,arguments)}C(tx,"checkEslint");function tA(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";X.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}C(tA,"printIssues");function t_(){return s(function(){var e,t,n;return g(this,function(r){switch(r.label){case 0:return[4,tg()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===K.Error}),n=e.filter(function(e){return e.type===K.Warning});!t.length&&!n.length?X.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tA("Warnings",n),tA("Errors",t),(t.length>0||n.length>0)&&A.default.exit(1));return[2]}})})()}C(t_,"showCheckResult");function tR(){return s(function(){var e,t,n,r,s;return g(this,function(i){switch(i.label){case 0:return[4,ty()];case 1:i.sent();return[4,ts({name:eI})];case 2:e=i.sent();if(!e.success){X.error("Failed to retrieve package information. Aborting lint-staged.");return[2]}t=e.result.isCurrentProject;if(!t)return[3,7];n=["Building package: ".concat(eI)];return[4,tt.build()];case 3:return[4,tN.apply(void 0,n.concat([i.sent()]))];case 4:i.sent();r=["Staging build artifacts"];return[4,tt.stageBuildDirectory()];case 5:return[4,tN.apply(void 0,r.concat([i.sent()]))];case 6:t=i.sent();i.label=7;case 7:t;s=["Executing lint-staged"];return[4,tt.lintStaged()];case 8:return[4,tN.apply(void 0,s.concat([i.sent()]))];case 9:i.sent(),t_();return[2]}})})()}C(tR,"lintStaged");function tb(){return s(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,tt.eslintInspect()];case 1:return[4,tN.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}C(tb,"inspectLint");function tG(){return s(function(){return g(this,function(e){switch(e.label){case 0:return[4,ty()];case 1:e.sent();return[4,Promise.all([tT(),tx()])];case 2:e.sent(),t_();return[2]}})})()}C(tG,"lintCheck");function tP(){return s(function(){return g(this,function(e){switch(e.label){case 0:return[4,ty()];case 1:e.sent();return[4,Promise.all([tT(),tx(!0)])];case 2:e.sent(),t_();return[2]}})})()}C(tP,"lintFix");function tM(){return s(function(){var e;return g(this,function(t){switch(t.label){case 0:return[4,ty()];case 1:t.sent();e=["Validating commit message"];return[4,tt.commitLint()];case 2:return[4,tN.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),t_();return[2]}})})()}C(tM,"commitLint");function tw(){return s(function(){var e,t,n,r;return g(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,tt.configureGitHook()];case 1:return[4,tN.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),em(e7.GIT_HOOK);return[4,tI(e9)];case 3:t=s.sent();ep(e7.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));n="\n".concat(eb,"\n");ef(e7.GIT_IGNORE)?ec(e7.GIT_IGNORE,"utf-8").split("\n").includes(eb)||eE(e7.GIT_IGNORE,n):ep(e7.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,tt.simpleGitHooks()];case 4:return[4,tN.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})})()}C(tw,"setupGitHook");function tj(){return s(function(){return g(this,function(e){switch(e.label){case 0:return[4,ta([{name:eI,type:ee.DEPENDENCY}],{update:!0,postInstallActions:[tw]})];case 1:e.sent();return[2]}})})()}C(tj,"prepare");function tL(){return s(function(){return g(this,function(e){switch(e.label){case 0:em(e7.NODE_MODULES,e7.PNPM_LOCK_YAML);return[4,to()];case 1:e.sent();return[4,tw()];case 2:e.sent();return[2]}})})()}C(tL,"reset");function tk(){return s(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,tt.nodeModulesInspect()];case 1:return[4,tN.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}C(tk,"inspect");function tU(){return s(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,tt.testUnit()];case 1:return[4,tN.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}C(tU,"testUnit");function tq(){return s(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,tt.testE2e()];case 1:return[4,tN.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}C(tq,"testE2E");function tF(e){return s(function(){var t;return g(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,tt.mongoMigrateCreate(e)];case 1:return[4,tN.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}C(tF,"mongoMigrateCreate");function tY(){return s(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,tt.mongoMigrateUp()];case 1:return[4,tN.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}C(tY,"mongoMigrateUp");function tV(){return s(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,tt.mongoMigrateDown()];case 1:return[4,tN.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}C(tV,"mongoMigrateDown");(function(){return s(function(){var e;return g(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,(0,R.default)((0,_.hideBin)(A.default.argv)).scriptName(eL).usage("$0 <command> [options]").command("lint","Check code for linting issues",tG).command("lint:fix","Fix linting issues automatically",tP).command("lint:inspect","View active ESLint configuration",tb).command("lint-staged","Run lint checks on staged files",tR).command("commitlint","Validate commit message format",tM).command("prepare","Initialize project and dependencies",tj).command("reset","Reset the project and reinstall dependencies",tL).command("inspect","Analyze installed project dependencies",tk).command("test:unit","Run unit test suite",tU).command("test:e2e","Run end-to-end test suite",tq).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},function(e){return s(function(){return g(this,function(t){switch(t.label){case 0:if(!e.name){X.error("Migration name is required.");return[2]}return[4,tF(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",tY).command("mongo:migrate:down","Rollback last MongoDB migration",tV).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(b.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();Z(e),A.default.exit(1);return[3,3];case 3:return[2]}})})()})();
1
+ "use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t,n,r,i,s,o){try{var a=e[s](o);var c=a.value}catch(e){n(e);return}if(a.done){t(c)}else{Promise.resolve(c).then(r,i)}}function i(e){return function(){var t=this,n=arguments;return new Promise(function(i,s){var o=e.apply(t,n);function a(e){r(o,i,s,a,c,"next",e)}function c(e){r(o,i,s,a,c,"throw",e)}a(undefined)})}}function s(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function o(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function a(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var i=true;var s=false;var o,a;try{for(n=n.call(e);!(i=(o=n.next()).done);i=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){s=true;a=e}finally{try{if(!i&&n["return"]!=null)n["return"]()}finally{if(s)throw a}}return r}function u(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){s(e,t,n[t])})}return e}function p(e,n){return t(e)||c(e,n)||m(e,n)||u()}function E(e){return n(e)||a(e)||m(e)||l()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function m(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function g(e,t){var n,r,i,s={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=a(0),o["throw"]=a(1),o["return"]=a(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return c([e,t])}}function c(a){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(s=0)),s)try{if(n=1,r&&(i=a[0]&2?r["return"]:a[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;if(r=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:s.label++;return{value:a[1],done:false};case 5:s.label++;r=a[1];a=[0];continue;case 7:a=s.ops.pop();s.trys.pop();continue;default:if(!(i=s.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){s=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(a[0]===6&&s.label<i[1]){s.label=i[1];i=a;break}if(i&&s.label<i[2]){s.label=i[2];s.ops.push(a);break}if(i[2])s.ops.pop();s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e];r=0}finally{n=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}var y=Object.create;var v=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var C=function(e,t){return v(e,"name",{value:t,configurable:!0})};var I=function(e,t,n,r){var i=true,s=false,o=undefined;if(t&&(typeof t==="undefined"?"undefined":f(t))=="object"||typeof t=="function")try{var a=function(){var i=u.value;!O.call(e,i)&&i!==n&&v(e,i,{get:function(){return t[i]},enumerable:!(r=h(t,i))||r.enumerable})};for(var c=S(t)[Symbol.iterator](),u;!(i=(u=c.next()).done);i=true)a()}catch(e){s=true;o=e}finally{try{if(!i&&c.return!=null){c.return()}}finally{if(s){throw o}}}return e};var N=function(e,t,n){return n=e!=null?y(D(e)):{},I(t||!e||!e.__esModule?v(n,"default",{value:e,enumerable:!0}):n,e)},T=function(e){return I(v({},"__esModule",{value:!0}),e)};var x={};module.exports=T(x);var A=N(require("process"),1),_=require("yargs/helpers"),R=N(require("yargs/yargs"),1);var b={name:"@cyberskill/shared",type:"module",version:"1.139.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./config":{types:"./dist/config/index.d.ts",import:"./dist/config/index.js",require:"./dist/config/index.cjs"},"./config/commitlint":{types:"./dist/config/commitlint/index.d.ts",import:"./dist/config/commitlint/index.js",require:"./dist/config/commitlint/index.cjs"},"./config/env":{types:"./dist/config/env/index.d.ts",import:"./dist/config/env/index.js",require:"./dist/config/env/index.cjs"},"./config/eslint":{types:"./dist/config/eslint/index.d.ts",import:"./dist/config/eslint/index.js",require:"./dist/config/eslint/index.cjs"},"./config/graphql-codegen":{types:"./dist/config/graphql-codegen/index.d.ts",import:"./dist/config/graphql-codegen/index.js",require:"./dist/config/graphql-codegen/index.cjs"},"./config/lint-staged":{types:"./dist/config/lint-staged/index.d.ts",import:"./dist/config/lint-staged/index.js",require:"./dist/config/lint-staged/index.cjs"},"./constant":{types:"./dist/constant/index.d.ts",import:"./dist/constant/index.js",require:"./dist/constant/index.cjs"},"./node":{types:"./dist/node/index.d.ts",import:"./dist/node/index.js",require:"./dist/node/index.cjs"},"./node/apollo-server":{types:"./dist/node/apollo-server/index.d.ts",import:"./dist/node/apollo-server/index.js",require:"./dist/node/apollo-server/index.cjs"},"./node/cli":{types:"./dist/node/cli/index.d.ts",import:"./dist/node/cli/index.js",require:"./dist/node/cli/index.cjs"},"./node/command":{types:"./dist/node/command/index.d.ts",import:"./dist/node/command/index.js",require:"./dist/node/command/index.cjs"},"./node/express":{types:"./dist/node/express/index.d.ts",import:"./dist/node/express/index.js",require:"./dist/node/express/index.cjs"},"./node/fs":{types:"./dist/node/fs/index.d.ts",import:"./dist/node/fs/index.js",require:"./dist/node/fs/index.cjs"},"./node/log":{types:"./dist/node/log/index.d.ts",import:"./dist/node/log/index.js",require:"./dist/node/log/index.cjs"},"./node/mongo":{types:"./dist/node/mongo/index.d.ts",import:"./dist/node/mongo/index.js",require:"./dist/node/mongo/index.cjs"},"./node/package":{types:"./dist/node/package/index.d.ts",import:"./dist/node/package/index.js",require:"./dist/node/package/index.cjs"},"./node/path":{types:"./dist/node/path/index.d.ts",import:"./dist/node/path/index.js",require:"./dist/node/path/index.cjs"},"./node/storage":{types:"./dist/node/storage/index.d.ts",import:"./dist/node/storage/index.js",require:"./dist/node/storage/index.cjs"},"./node/ws":{types:"./dist/node/ws/index.d.ts",import:"./dist/node/ws/index.js",require:"./dist/node/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./style/reset.css":{import:"./dist/style/reset.css",require:"./dist/style/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./util":{types:"./dist/util/index.d.ts",import:"./dist/util/index.js",require:"./dist/util/index.cjs"}},typesVersions:{"*":{config:["dist/config/index.d.ts"],constant:["dist/constant/index.d.ts"],node:["dist/node/index.d.ts"],react:["dist/react/index.d.ts"],typescript:["dist/typescript/index.d.ts"],util:["dist/util/index.d.ts"]}},bin:{cyberskill:"dist/node/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"tsup --watch",lint:"tsx src/node/cli/index.ts lint","lint:fix":"tsx src/node/cli/index.ts lint:fix","lint:inspect":"tsx src/node/cli/index.ts lint:inspect",reset:"tsx src/node/cli/index.ts reset",prepare:"tsx src/node/cli/index.ts prepare",inspect:"tsx src/node/cli/index.ts inspect","test:unit":"tsx src/node/cli/index.ts test:unit","test:e2e":"tsx src/node/cli/index.ts test:e2e",commitlint:"tsx src/node/cli/index.ts commitlint"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@dotenvx/dotenvx":"1.42.2","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.5","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.7","@nestjs/common":"11.1.0","@nestjs/core":"11.1.0","@next/eslint-plugin-next":"15.3.1","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.9.0","@vitest/browser":"3.1.2","body-parser":"2.2.0",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2","cookie-parser":"1.4.7",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0","dotenv-cli":"8.0.0",envalid:"8.0.0","eslint-config-next":"15.3.1","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20",express:"4.21.2","express-session":"1.18.1","express-useragent":"1.0.15","fs-extra":"11.3.0",globals:"16.0.0",graphql:"16.11.0","graphql-ws":"6.0.4",i18next:"25.0.2",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3","modern-normalize":"3.0.1",mongodb:"6.16.0",mongoose:"8.14.1","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.1.0","node-fetch":"3.3.2","node-persist":"4.0.4",playwright:"1.52.0","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.5.1","react-icons":"5.5.0",sass:"1.87.0",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.4",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.4",vitest:"3.1.2","vitest-browser-react":"0.1.1",ws:"8.18.2",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@commitlint/config-conventional":"19.8.0","@eslint/config-inspector":"1.0.2","@types/body-parser":"1.19.5","@types/compression":"1.7.5","@types/cookie-parser":"1.4.8","@types/cors":"2.8.17","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.1","@types/express-useragent":"1.0.5","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node":"22.15.3","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.3","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.26.0","lint-staged":"15.5.1","node-modules-inspector":"0.6.7","simple-git-hooks":"2.13.0"}};var G=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});var P=require("child_process"),M=N(require("process"),1),w=N(require("util"),1);var j=".cyberskill-storage";var L=N(require("@dotenvx/dotenvx"),1),k=require("envalid"),U=N(require("os"),1),q=N(require("path"),1),F=N(require("process"),1);var Y=!1;function V(){Y||(L.default.config(),Y=!0)}C(V,"loadEnvFile");function B(){V();var e=(0,k.cleanEnv)(F.default.env,{CWD:(0,k.str)({default:F.default.cwd()}),DEBUG:(0,k.bool)({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:(0,k.str)({default:q.default.join(U.default.homedir(),j)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}C(B,"getEnv");var K=function(e){return e.Error="error",e.Warning="warning",e}({});var H=N(require("chalk"),1),Q=N(require("consola"),1),W=require("graphql");var J={GRAPHQL_PARSE_FAILED:{CODE:"GRAPHQL_PARSE_FAILED",MESSAGE:"The GraphQL operation string contains a syntax error."},GRAPHQL_VALIDATION_FAILED:{CODE:"GRAPHQL_VALIDATION_FAILED",MESSAGE:"The GraphQL operation is not valid against the server's schema."},BAD_USER_INPUT:{CODE:"BAD_USER_INPUT",MESSAGE:"The GraphQL operation includes an invalid value for a field argument."},PERSISTED_QUERY_NOT_FOUND:{CODE:"PERSISTED_QUERY_NOT_FOUND",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the query was not in the APQ cache."},PERSISTED_QUERY_NOT_SUPPORTED:{CODE:"PERSISTED_QUERY_NOT_SUPPORTED",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the server has disabled APQ."},OPERATION_RESOLUTION_FAILURE:{CODE:"OPERATION_RESOLUTION_FAILURE",MESSAGE:"The request was parsed successfully and is valid against the server's schema, but the server couldn't resolve which operation to run. This occurs when a request containing multiple named operations doesn't specify which operation to run (i.e.,operationName), or if the named operation isn't included in the request."},CONTINUE:{CODE:100,MESSAGE:"Continue"},SWITCHING_PROTOCOLS:{CODE:101,MESSAGE:"Switching Protocols"},PROCESSING:{CODE:102,MESSAGE:"Processing"},OK:{CODE:200,MESSAGE:"OK"},CREATED:{CODE:201,MESSAGE:"Created"},ACCEPTED:{CODE:202,MESSAGE:"Accepted"},NON_AUTHORITATIVE_INFORMATION:{CODE:203,MESSAGE:"Non Authoritative Information"},NO_CONTENT:{CODE:204,MESSAGE:"No Content"},RESET_CONTENT:{CODE:205,MESSAGE:"Reset Content"},PARTIAL_CONTENT:{CODE:206,MESSAGE:"Partial Content"},MULTI_STATUS:{CODE:207,MESSAGE:"Multi-Status"},MULTIPLE_CHOICES:{CODE:300,MESSAGE:"Multiple Choices"},MOVED_PERMANENTLY:{CODE:301,MESSAGE:"Moved Permanently"},MOVED_TEMPORARILY:{CODE:302,MESSAGE:"Moved Temporarily"},SEE_OTHER:{CODE:303,MESSAGE:"See Other"},NOT_MODIFIED:{CODE:304,MESSAGE:"Not Modified"},USE_PROXY:{CODE:305,MESSAGE:"Use Proxy"},TEMPORARY_REDIRECT:{CODE:307,MESSAGE:"Temporary Redirect"},PERMANENT_REDIRECT:{CODE:308,MESSAGE:"Permanent Redirect"},BAD_REQUEST:{CODE:400,MESSAGE:"Bad Request"},UNAUTHORIZED:{CODE:401,MESSAGE:"Unauthorized"},PAYMENT_REQUIRED:{CODE:402,MESSAGE:"Payment Required"},FORBIDDEN:{CODE:403,MESSAGE:"Forbidden"},NOT_FOUND:{CODE:404,MESSAGE:"Not Found"},METHOD_NOT_ALLOWED:{CODE:405,MESSAGE:"Method Not Allowed"},NOT_ACCEPTABLE:{CODE:406,MESSAGE:"Not Acceptable"},PROXY_AUTHENTICATION_REQUIRED:{CODE:407,MESSAGE:"Proxy Authentication Required"},REQUEST_TIMEOUT:{CODE:408,MESSAGE:"Request Timeout"},CONFLICT:{CODE:409,MESSAGE:"Conflict"},GONE:{CODE:410,MESSAGE:"Gone"},LENGTH_REQUIRED:{CODE:411,MESSAGE:"Length Required"},PRECONDITION_FAILED:{CODE:412,MESSAGE:"Precondition Failed"},REQUEST_TOO_LONG:{CODE:413,MESSAGE:"Request Entity Too Large"},REQUEST_URI_TOO_LONG:{CODE:414,MESSAGE:"Request-URI Too Long"},UNSUPPORTED_MEDIA_TYPE:{CODE:415,MESSAGE:"Unsupported Media Type"},REQUESTED_RANGE_NOT_SATISFIABLE:{CODE:416,MESSAGE:"Requested Range Not Satisfiable"},EXPECTATION_FAILED:{CODE:417,MESSAGE:"Expectation Failed"},IM_A_TEAPOT:{CODE:418,MESSAGE:"I'm a teapot"},INSUFFICIENT_SPACE_ON_RESOURCE:{CODE:419,MESSAGE:"Insufficient Space on Resource"},METHOD_FAILURE:{CODE:420,MESSAGE:"Method Failure"},MISDIRECTED_REQUEST:{CODE:421,MESSAGE:"Misdirected Request"},UNPROCESSABLE_ENTITY:{CODE:422,MESSAGE:"Unprocessable Entity"},LOCKED:{CODE:423,MESSAGE:"Locked"},FAILED_DEPENDENCY:{CODE:424,MESSAGE:"Failed Dependency"},PRECONDITION_REQUIRED:{CODE:428,MESSAGE:"Precondition Required"},TOO_MANY_REQUESTS:{CODE:429,MESSAGE:"Too Many Requests"},REQUEST_HEADER_FIELDS_TOO_LARGE:{CODE:431,MESSAGE:"Request Header Fields Too Large"},UNAVAILABLE_FOR_LEGAL_REASONS:{CODE:451,MESSAGE:"Unavailable For Legal Reasons"},INTERNAL_SERVER_ERROR:{CODE:500,MESSAGE:"Internal Server Error"},NOT_IMPLEMENTED:{CODE:501,MESSAGE:"Not Implemented"},BAD_GATEWAY:{CODE:502,MESSAGE:"Bad Gateway"},SERVICE_UNAVAILABLE:{CODE:503,MESSAGE:"Service Unavailable"},GATEWAY_TIMEOUT:{CODE:504,MESSAGE:"Gateway Timeout"},HTTP_VERSION_NOT_SUPPORTED:{CODE:505,MESSAGE:"HTTP Version Not Supported"},INSUFFICIENT_STORAGE:{CODE:507,MESSAGE:"Insufficient Storage"},NETWORK_AUTHENTICATION_REQUIRED:{CODE:511,MESSAGE:"Network Authentication Required"}};var z=B();z.DEBUG||(Q.default.level=4);function $(e){var t=H.default[e];return typeof t=="function"?t:H.default.green}C($,"chalkKeyword");var X={silent:Q.default.silent,level:Q.default.level,fatal:Q.default.fatal,error:Q.default.error,warn:Q.default.warn,log:Q.default.log,info:Q.default.info,success:Q.default.success,ready:Q.default.ready,start:Q.default.start,box:Q.default.box,debug:Q.default.debug,trace:Q.default.trace,verbose:Q.default.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){Q.default.box(H.default.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,i=e.rule,s=e.message;Q.default.log("".concat(H.default.gray("File:")," ").concat(H.default.blue("".concat(t).concat(r?":".concat(r):"")))),i&&Q.default.log(" ".concat($(n)("Rule:")," ").concat(i)),Q.default.log(" ".concat($(n)("Message:")," ").concat(s))}),Q.default.box($(n)("".concat(e," : ").concat(t.length))),Q.default.log(H.default.gray("─".repeat(40)))}};function Z(e,t){var n=t!==null&&t!==void 0?t:{},r=n.shouldLog,i=r===void 0?!0:r,s=n.returnValue,a=n.callback,c=o(e,Error)?e:new Error(typeof e=="string"?e:"Unknown error");return i&&X.error(c.message),a&&typeof a=="function"&&a(c),s||{success:!1,message:c.message,code:J.INTERNAL_SERVER_ERROR.CODE}}C(Z,"catchError");var ee=function(e){return e.DEPENDENCY="dependencies",e.DEV_DEPENDENCY="devDependencies",e.PEER_DEPENDENCY="peerDependencies",e.BUNDLE_DEPENDENCY="bundleDependencies",e.OPTIONAL_DEPENDENCY="optionalDependencies",e}({});var et=N(require("node-fetch"),1);var en=N(require("fs-extra"),1),er=N(require("path"),1);var ei=en.default,es=ei.lstatSync,eo=ei.readdirSync,ea=ei.mkdirSync,ec=ei.readFileSync,eu=ei.unlinkSync,el=ei.statSync,ed=en.default.readJsonSync;function ep(e,t,n){en.default.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}C(ep,"writeFileSync");function eE(e,t,n){en.default.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}C(eE,"appendFileSync");function ef(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return en.default.pathExistsSync(e)})}C(ef,"pathExistsSync");function em(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){ef(e)&&en.default.removeSync(e)})}C(em,"removeSync");var eg=N(require("fs-extra"),1);var ey=N(require("path"),1);var ev=B(),eh=ey.default;function eS(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=eh).resolve.apply(r,[ev.CWD].concat(E(t)))}C(eS,"resolveWorkingPath");function eD(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=eh).join.apply(r,E(t))}C(eD,"join");var eO=B(),eC=eO.CWD,eI="@cyberskill/shared",eN="node_modules",eT="dist",ex="package.json",eA="package-lock.json",e_="tsconfig.json",eR=".gitignore",eb=".simple-git-hooks.json",eG="pnpm-lock.yaml",eP=".git/hooks/",eM=".git/COMMIT_EDITMSG",ew=".migrate-mongo.config.js",ej=function(){var e=eg.default.readJsonSync(eS(ex)).name===eI?eC:eD(eC,eN,eI);return eD(e,eT)}(),eL="cyberskill",ek="src/node/cli/index.ts",eU="eslint",eq="eslint",eF="vitest";var eY="vitest",eV="@commitlint/cli",eB="@commitlint/config-conventional",eK="commitlint",eH="lint-staged",eQ="lint-staged",eW="typescript",eJ="tsc",ez="tsx",e$="git",eX="pnpm",eZ="pnpm exec",e0="simple-git-hooks",e1="simple-git-hooks",e2="@eslint/config-inspector",e4="eslint-config-inspector",e3="node-modules-inspector",e5="node-modules-inspector",e8="migrate-mongo",e6="./node_modules/migrate-mongo/bin/migrate-mongo",e7={CYBERSKILL_DIRECTORY:ej,WORKING_DIRECTORY:eC,TS_CONFIG:eS(e_),GIT_IGNORE:eS(eR),GIT_HOOK:eS(eP),GIT_COMMIT_MSG:eS(eM),SIMPLE_GIT_HOOKS_JSON:eS(eb),PACKAGE_JSON:eS(ex),PACKAGE_LOCK_JSON:eS(eA),PNPM_LOCK_YAML:eS(eG),NODE_MODULES:eS(eN),MIGRATE_MONGO_CONFIG:eS(ew),LINT_STAGED_CONFIG:eS("".concat(ej,"/config/lint-staged/index.js")),COMMITLINT_CONFIG:eS("".concat(ej,"/config/commitlint/index.js")),UNIT_TEST_CONFIG:eS("".concat(ej,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:eS("".concat(ej,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:eS("".concat(ej,"/react/vitest/vitest.e2e.js"))};function e9(e){var t=e.isCurrentProject;return d({"pre-commit":eQ,"commit-msg":eK},t&&{"pre-push":tD("".concat(e$," pull"))})}C(e9,"createGitHooksConfig");function te(e){var t=e.type,n=e.packages,r=e.command;var s=n===null||n===void 0?void 0:n.reduce(function(e,t){return e.some(function(e){return e.name===t.name})||e.push(t),e},[]);return function(){return i(function(){var e;return g(this,function(n){switch(n.label){case 0:switch(t){case G.CLI:return[3,1];case G.STRING:return[3,4]}return[3,5];case 1:e=s===null||s===void 0?void 0:s.length;if(!e)return[3,3];return[4,ta(s,{update:!0})];case 2:e=n.sent();n.label=3;case 3:return[2,(e,tC(tD("".concat(eZ," ").concat(r))))];case 4:return[2,tC(tD(r))];case 5:throw new Error("Unsupported command type");case 6:return[2]}})})()}}C(te,"buildCommand");var tt={simpleGitHooks:te({type:G.CLI,packages:[{name:e0,type:ee.DEV_DEPENDENCY}],command:e1}),eslintInspect:te({type:G.CLI,packages:[{name:e2,type:ee.DEV_DEPENDENCY}],command:e4}),nodeModulesInspect:te({type:G.CLI,packages:[{name:e3,type:ee.DEV_DEPENDENCY}],command:e5}),eslintCheck:te({type:G.CLI,packages:[{name:eU,type:ee.DEV_DEPENDENCY}],command:"".concat(eq," ").concat(e7.WORKING_DIRECTORY," --no-cache")}),eslintFix:te({type:G.CLI,packages:[{name:eU,type:ee.DEV_DEPENDENCY}],command:"".concat(eq," ").concat(e7.WORKING_DIRECTORY," --fix --no-cache")}),typescriptCheck:te({type:G.CLI,packages:[{name:eW,type:ee.DEPENDENCY}],command:"".concat(eJ," -p ").concat(e7.TS_CONFIG," --noEmit")}),testUnit:te({type:G.CLI,packages:[{name:eF,type:ee.DEV_DEPENDENCY}],command:"".concat(eY," --config ").concat(e7.UNIT_TEST_CONFIG)}),testE2e:te({type:G.CLI,packages:[{name:eF,type:ee.DEV_DEPENDENCY}],command:"".concat(eY," --config ").concat(e7.E2E_TEST_CONFIG)}),mongoMigrateCreate:C(function(e){return te({type:G.CLI,packages:[{name:e8,type:ee.DEPENDENCY}],command:"".concat(ez," ").concat(e6," create ").concat(e," -f ").concat(e7.MIGRATE_MONGO_CONFIG)})()},"mongoMigrateCreate"),mongoMigrateUp:te({type:G.CLI,packages:[{name:e8,type:ee.DEPENDENCY}],command:"".concat(ez," ").concat(e6," up -f ").concat(e7.MIGRATE_MONGO_CONFIG)}),mongoMigrateDown:te({type:G.CLI,packages:[{name:e8,type:ee.DEPENDENCY}],command:"".concat(ez," ").concat(e6," down -f ").concat(e7.MIGRATE_MONGO_CONFIG)}),commitLint:te({type:G.CLI,packages:[{name:eV,type:ee.DEV_DEPENDENCY},{name:eB,type:ee.DEV_DEPENDENCY}],command:"".concat(eK," --edit ").concat(e7.GIT_COMMIT_MSG," --config ").concat(e7.COMMITLINT_CONFIG)}),lintStaged:te({type:G.CLI,packages:[{name:eH,type:ee.DEV_DEPENDENCY}],command:"".concat(eQ," --config ").concat(e7.LINT_STAGED_CONFIG)}),configureGitHook:te({type:G.STRING,command:"".concat(e$," config core.hooksPath ").concat(e7.GIT_HOOK)}),stageBuildDirectory:te({type:G.STRING,command:"".concat(e$," add ").concat(eT)}),build:te({type:G.STRING,command:"".concat(eX," run --if-present build")}),pnpmInstallStandard:te({type:G.STRING,command:"".concat(eX," install --no-frozen-lockfile")}),pnpmInstallLegacy:te({type:G.STRING,command:"".concat(eX," install --no-frozen-lockfile --legacy-peer-deps")}),pnpmInstallForce:te({type:G.STRING,command:"".concat(eX," install --no-frozen-lockfile --force")})};var tn=B();function tr(e){return i(function(){var t,n,r,i;return g(this,function(s){switch(s.label){case 0:s.trys.push([0,3,,4]);return[4,(0,et.default)("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=s.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=s.sent(),r=n.version;return[2,{success:!0,result:r}];case 3:i=s.sent();return[2,Z(i)];case 4:return[2]}})})()}C(tr,"getLatestPackageVersion");function ti(e){return i(function(){var t,n,r,i,s,o,a,c,u,l,d,p,E,f,m,y,v,h,S;return g(this,function(g){switch(g.label){case 0:g.trys.push([0,2,,3]);if(!ef(e7.PACKAGE_JSON))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===ee.DEPENDENCY,isDevDependency:e.type===ee.DEV_DEPENDENCY,installedPath:"",file:{}}}];t=ed(e7.PACKAGE_JSON),n=t.name,r=t.version,i=r===void 0?"":r,s=t.dependencies,o=s===void 0?{}:s,a=t.devDependencies,c=a===void 0?{}:a;if(e.name===n)return[2,{success:!0,result:{name:n,currentVersion:i,latestVersion:i,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:e.type===ee.DEPENDENCY,isDevDependency:e.type===ee.DEV_DEPENDENCY,installedPath:e7.PACKAGE_JSON,file:t}}];u=e.name in o,l=e.name in c;return[4,tr(e.name)];case 1:d=g.sent();if(!d.success)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:u,isDevDependency:l,installedPath:"",file:{}}}];if(!u&&!l)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:d.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===ee.DEPENDENCY,isDevDependency:e.type===ee.DEV_DEPENDENCY,installedPath:"",file:{}}}];f=(E=(p=o[e.name])!==null&&p!==void 0?p:c[e.name])!==null&&E!==void 0?E:"",m=eD(tn.CWD,eN,e.name,ex);if(!ef(m))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:d.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:u,isDevDependency:l,installedPath:"",file:{}}}];y=ed(m),v=y.version,h=v===void 0?"":v;return[2,f!==h?{success:!0,result:{name:e.name,currentVersion:h||f,latestVersion:d.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:!1,isDependency:u,isDevDependency:l,installedPath:m,file:y}}:{success:!0,result:{name:e.name,currentVersion:f,latestVersion:d.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:f===d.result,isDependency:u,isDevDependency:l,installedPath:m,file:y}}];case 2:S=g.sent();return[2,Z(S)];case 3:return[2]}})})()}C(ti,"getPackage");function ts(e){return i(function(){var t,n,r,i,s;return g(this,function(o){try{;r=ed(e7.PACKAGE_JSON),i=(t=r.dependencies)!==null&&t!==void 0?t:{},s=(n=r.devDependencies)!==null&&n!==void 0?n:{};e.isDependency?i[e.name]=e.latestVersion:e.isDevDependency&&(s[e.name]=e.latestVersion),ep(e7.PACKAGE_JSON,JSON.stringify(r,null,4)),X.info('Updated "'.concat(e.name,'" to version ').concat(e.latestVersion))}catch(e){Z(e)}return[2]})})()}C(ts,"updatePackage");function to(){return i(function(){var e,t,n,r,i,s,o,a,c,u,l,d,p;return g(this,function(E){switch(E.label){case 0:E.trys.push([0,12,,13]);e=[{command:C(function(){return tt.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:C(function(){return tt.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:C(function(){return tt.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;E.label=1;case 1:E.trys.push([1,9,10,11]);i=e[Symbol.iterator]();E.label=2;case 2:if(!!(t=(s=i.next()).done))return[3,8];o=s.value,a=o.command,c=o.message;E.label=3;case 3:E.trys.push([3,6,,7]);return[4,a()];case 4:u=E.sent();return[4,tN("".concat(c," using: ").concat(u),u)];case 5:E.sent();return[2];case 6:l=E.sent();Z(l);return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=E.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&i.return!=null){i.return()}}finally{if(n){throw r}}return[7];case 11:return[3,13];case 12:p=E.sent();Z(p);return[3,13];case 13:return[2]}})})()}C(to,"installDependencies");function ta(e,t){return i(function(){var n,r,i,s,o,a,c,u,l,d,p,E;return g(this,function(f){switch(f.label){case 0:if(!ef(e7.PACKAGE_JSON)){X.error("package.json not found. Aborting setup.");return[2]}f.label=1;case 1:f.trys.push([1,16,,17]);return[4,Promise.all(e.map(ti))];case 2:n=f.sent().filter(function(e){return e.success?!e.result.isCurrentProject&&(!e.result.isInstalled||!e.result.isUpToDate):!1});r=n.length>0;if(!r)return[3,7];return[4,Promise.all(n.map(function(e){return e.success?ts(e.result):Promise.resolve()}))];case 3:f.sent();return[4,to()];case 4:f.sent();i=["Running ESLint with auto-fix"];return[4,tt.eslintFix()];case 5:return[4,tN.apply(void 0,i.concat([f.sent()]))];case 6:r=f.sent();f.label=7;case 7:r;o=true,a=false,c=undefined;f.label=8;case 8:f.trys.push([8,13,14,15]);u=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();f.label=9;case 9:if(!!(o=(l=u.next()).done))return[3,12];d=l.value;return[4,d()];case 10:f.sent();f.label=11;case 11:o=true;return[3,9];case 12:return[3,15];case 13:p=f.sent();a=true;c=p;return[3,15];case 14:try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw c}}return[7];case 15:return[3,17];case 16:E=f.sent();Z(E);return[3,17];case 17:return[2]}})})()}C(ta,"setupPackages");var tc=N(require("node-persist"),1);var tu=B();function tl(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=tc.default.defaultInstance;if(e)return[3,2];return[4,tc.default.init({dir:tu.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}C(tl,"initNodePersist");var td={get:function e(e){return i(function(){var t,n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tl()];case 1:r.sent();return[4,tc.default.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,Z(n,{returnValue:null})];case 4:return[2]}})})()},set:function e(e,t){return i(function(){var n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tl()];case 1:r.sent();return[4,tc.default.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();Z(n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return i(function(){var t;return g(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tl()];case 1:n.sent();return[4,tc.default.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();Z(t);return[3,4];case 4:return[2]}})})()},keys:function e(){return i(function(){var e,t;return g(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tl()];case 1:n.sent();return[4,tc.default.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(X.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,Z(t,{returnValue:[]})];case 4:return[2]}})})()},getLogLink:function e(e){return i(function(){return g(this,function(t){try{return[2,"".concat(tu.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,Z(e,{returnValue:null})]}return[2]})})()}};var tp=B(),tE=w.promisify(P.exec);function tf(e){return"error_list:".concat(e)}C(tf,"getErrorListKey");function tm(e){return i(function(){var t,n,r;return g(this,function(s){switch(s.label){case 0:if(e.length===0)return[2];t=Date.now(),n=tf(t);s.label=1;case 1:s.trys.push([1,3,,4]);return[4,td.set(n,{errors:e,timestamp:t})];case 2:s.sent(),setTimeout(function(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:return[4,td.getLogLink(n)];case 1:e=t.sent();e&&X.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},10);return[3,4];case 3:r=s.sent();Z(r);return[3,4];case 4:return[2]}})})()}C(tm,"saveErrorListToStorage");function tg(){return i(function(){var e,t,n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,td.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return i(function(){var t;return g(this,function(n){switch(n.label){case 0:return[4,td.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})})()}))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,Z(n,{returnValue:[]})];case 4:return[2]}})})()}C(tg,"getStoredErrorLists");function ty(){return i(function(){var e,t,n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,td.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return td.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();Z(n);return[3,4];case 4:return[2]}})})()}C(ty,"clearAllErrorLists");function tv(e){var t=[],n=[],r="",i=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,s=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var a,c,u,l,d;var p=i.exec(e)||[],E=s.exec(e)||[],f=o.exec(e)||[];var m,g,y,v,h,S;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===K.Error?K.Error:K.Warning,message:(m=p===null||p===void 0?void 0:(a=p[4])===null||a===void 0?void 0:a.trim())!==null&&m!==void 0?m:"",rule:(g=p===null||p===void 0?void 0:(c=p[5])===null||c===void 0?void 0:c.trim())!==null&&g!==void 0?g:""}):E.length?t.push({file:(y=E===null||E===void 0?void 0:E[1])!==null&&y!==void 0?y:"",position:"".concat(E[2],":").concat(E[3]),type:E[4]===K.Error?K.Error:K.Warning,message:(v=E===null||E===void 0?void 0:(u=E[5])===null||u===void 0?void 0:u.trim())!==null&&v!==void 0?v:""}):f.length?t.push({file:"commitlint",type:K.Error,message:(h=f===null||f===void 0?void 0:(l=f[1])===null||l===void 0?void 0:l.trim())!==null&&h!==void 0?h:"",rule:(S=f===null||f===void 0?void 0:(d=f[2])===null||d===void 0?void 0:d.trim())!==null&&S!==void 0?S:""}):n.push(e.trim())}}),t.length&&tm(t),tp.DEBUG&&n.length&&(X.warn("Unmatched lines:"),n.forEach(function(e){return X.info(" ".concat(e))}))}C(tv,"parseTextErrors");function th(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,i=e.line,s=e.column,o=e.ruleId,a=e.message;n.push({type:r===2?K.Error:K.Warning,file:t,position:"".concat(i,":").concat(s),rule:o,message:a})})}),n.length&&tm(n)}catch(t){tv(e)}}C(th,"parseCommandOutput");function tS(e){return i(function(e){var t,n,r,i,s,o,a,c,u;var l=arguments;return g(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:th;n=new AbortController;M.default.on("SIGINT",function(){X.warn("Process interrupted. Terminating..."),n.abort(),M.default.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,tE(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),i=r.stdout,s=r.stderr;[i,s].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:o=d.sent();a=o.stdout,c=o.stderr,u=o.message;[a,c].forEach(function(e){return e&&t(e)}),!c&&!a&&X.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}C(tS,"executeCommand");function tD(e){return{raw:!0,cmd:e}}C(tD,"rawCommand");function tO(e,t){return(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eZ," ").concat(ez," ").concat(ek," ").concat(e):"".concat(eZ," ").concat(eL," ").concat(e)}C(tO,"formatCLI");function tC(e,t){return typeof e=="function"?tO(e(t),t):(typeof e==="undefined"?"undefined":f(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tO(e,t):e}C(tC,"formatCommand");function tI(e){return i(function(){var t,n,r;return g(this,function(i){switch(i.label){case 0:return[4,ti({name:eI})];case 1:t=i.sent();if(t.success){n={isCurrentProject:t.result.isCurrentProject},r=typeof e=="function"?e(n):e;return[2,Object.fromEntries(Object.entries(r).map(function(e){var t=p(e,2),r=t[0],i=t[1];return[r,tC(i,n)]}))]}return[2]}})})()}C(tI,"resolveCommands");function tN(e,t){return i(function(){var n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);X.start("".concat(e)),tp.DEBUG&&X.info("→ ".concat(t));return[4,tS(t)];case 1:r.sent(),X.success("".concat(e," done."));return[3,3];case 2:n=r.sent();Z(n);return[3,3];case 3:return[2]}})})()}C(tN,"runCommand");function tT(){return i(function(){var e,t;return g(this,function(n){switch(n.label){case 0:if(!ef(e7.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,tt.typescriptCheck()];case 1:return[4,tN.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=X.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}C(tT,"checkTypescript");function tx(){return i(function(){var e,t,n,r;var i=arguments;return g(this,function(s){switch(s.label){case 0:e=i.length>0&&i[0]!==void 0?i[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,tt.eslintFix()];case 1:return[4,tN.apply(void 0,n.concat([s.sent()]))];case 2:t=s.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,tt.eslintCheck()];case 4:return[4,tN.apply(void 0,r.concat([s.sent()]))];case 5:t=s.sent();s.label=6;case 6:t;return[2]}})}).apply(this,arguments)}C(tx,"checkEslint");function tA(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";X.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}C(tA,"printIssues");function t_(){return i(function(){var e,t,n;return g(this,function(r){switch(r.label){case 0:return[4,tg()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===K.Error}),n=e.filter(function(e){return e.type===K.Warning});!t.length&&!n.length?X.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tA("Warnings",n),tA("Errors",t),(t.length>0||n.length>0)&&A.default.exit(1));return[2]}})})()}C(t_,"showCheckResult");function tR(){return i(function(){var e,t,n,r,i;return g(this,function(s){switch(s.label){case 0:return[4,ty()];case 1:s.sent();return[4,ti({name:eI})];case 2:e=s.sent();if(!e.success){X.error("Failed to retrieve package information. Aborting lint-staged.");return[2]}t=e.result.isCurrentProject;if(!t)return[3,7];n=["Building package: ".concat(eI)];return[4,tt.build()];case 3:return[4,tN.apply(void 0,n.concat([s.sent()]))];case 4:s.sent();r=["Staging build artifacts"];return[4,tt.stageBuildDirectory()];case 5:return[4,tN.apply(void 0,r.concat([s.sent()]))];case 6:t=s.sent();s.label=7;case 7:t;i=["Executing lint-staged"];return[4,tt.lintStaged()];case 8:return[4,tN.apply(void 0,i.concat([s.sent()]))];case 9:s.sent(),t_();return[2]}})})()}C(tR,"lintStaged");function tb(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,tt.eslintInspect()];case 1:return[4,tN.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}C(tb,"inspectLint");function tG(){return i(function(){return g(this,function(e){switch(e.label){case 0:return[4,ty()];case 1:e.sent();return[4,Promise.all([tT(),tx()])];case 2:e.sent(),t_();return[2]}})})()}C(tG,"lintCheck");function tP(){return i(function(){return g(this,function(e){switch(e.label){case 0:return[4,ty()];case 1:e.sent();return[4,Promise.all([tT(),tx(!0)])];case 2:e.sent(),t_();return[2]}})})()}C(tP,"lintFix");function tM(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:return[4,ty()];case 1:t.sent();e=["Validating commit message"];return[4,tt.commitLint()];case 2:return[4,tN.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),t_();return[2]}})})()}C(tM,"commitLint");function tw(){return i(function(){var e,t,n,r;return g(this,function(i){switch(i.label){case 0:e=["Configuring Git hooks"];return[4,tt.configureGitHook()];case 1:return[4,tN.apply(void 0,e.concat([i.sent()]))];case 2:i.sent(),em(e7.GIT_HOOK);return[4,tI(e9)];case 3:t=i.sent();ep(e7.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));n="\n".concat(eb,"\n");ef(e7.GIT_IGNORE)?ec(e7.GIT_IGNORE,"utf-8").split("\n").includes(eb)||eE(e7.GIT_IGNORE,n):ep(e7.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,tt.simpleGitHooks()];case 4:return[4,tN.apply(void 0,r.concat([i.sent()]))];case 5:i.sent();return[2]}})})()}C(tw,"setupGitHook");function tj(){return i(function(){return g(this,function(e){switch(e.label){case 0:return[4,ta([{name:eI,type:ee.DEPENDENCY}],{update:!0,postInstallActions:[tw]})];case 1:e.sent();return[2]}})})()}C(tj,"prepare");function tL(){return i(function(){return g(this,function(e){switch(e.label){case 0:em(e7.NODE_MODULES,e7.PNPM_LOCK_YAML);return[4,to()];case 1:e.sent();return[4,tw()];case 2:e.sent();return[2]}})})()}C(tL,"reset");function tk(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,tt.nodeModulesInspect()];case 1:return[4,tN.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}C(tk,"inspect");function tU(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,tt.testUnit()];case 1:return[4,tN.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}C(tU,"testUnit");function tq(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,tt.testE2e()];case 1:return[4,tN.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}C(tq,"testE2E");function tF(e){return i(function(){var t;return g(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,tt.mongoMigrateCreate(e)];case 1:return[4,tN.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}C(tF,"mongoMigrateCreate");function tY(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,tt.mongoMigrateUp()];case 1:return[4,tN.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}C(tY,"mongoMigrateUp");function tV(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,tt.mongoMigrateDown()];case 1:return[4,tN.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}C(tV,"mongoMigrateDown");(function(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,(0,R.default)((0,_.hideBin)(A.default.argv)).scriptName(eL).usage("$0 <command> [options]").command("lint","Check code for linting issues",tG).command("lint:fix","Fix linting issues automatically",tP).command("lint:inspect","View active ESLint configuration",tb).command("lint-staged","Run lint checks on staged files",tR).command("commitlint","Validate commit message format",tM).command("prepare","Initialize project and dependencies",tj).command("reset","Reset the project and reinstall dependencies",tL).command("inspect","Analyze installed project dependencies",tk).command("test:unit","Run unit test suite",tU).command("test:e2e","Run end-to-end test suite",tq).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},function(e){return i(function(){return g(this,function(t){switch(t.label){case 0:if(!e.name){X.error("Migration name is required.");return[2]}return[4,tF(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",tY).command("mongo:migrate:down","Rollback last MongoDB migration",tV).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(b.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();Z(e),A.default.exit(1);return[3,3];case 3:return[2]}})})()})();
@@ -1 +1 @@
1
- function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t,n,r,s,i,o){try{var a=e[i](o);var c=a.value}catch(e){n(e);return}if(a.done){t(c)}else{Promise.resolve(c).then(r,s)}}function s(e){return function(){var t=this,n=arguments;return new Promise(function(s,i){var o=e.apply(t,n);function a(e){r(o,s,i,a,c,"next",e)}function c(e){r(o,s,i,a,c,"throw",e)}a(undefined)})}}function i(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function o(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function a(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var s=true;var i=false;var o,a;try{for(n=n.call(e);!(s=(o=n.next()).done);s=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;a=e}finally{try{if(!s&&n["return"]!=null)n["return"]()}finally{if(i)throw a}}return r}function u(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){i(e,t,n[t])})}return e}function p(e,n){return t(e)||c(e,n)||m(e,n)||u()}function E(e){return n(e)||a(e)||m(e)||l()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function m(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function g(e,t){var n,r,s,i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=a(0),o["throw"]=a(1),o["return"]=a(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return c([e,t])}}function c(a){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(i=0)),i)try{if(n=1,r&&(s=a[0]&2?r["return"]:a[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;if(r=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;r=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(a[0]===6&&i.label<s[1]){i.label=s[1];s=a;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(a);break}if(s[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];r=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}var y=Object.defineProperty;var h=function(e,t){return y(e,"name",{value:t,configurable:!0})};import S from"node:process";import{hideBin as v}from"yargs/helpers";import D from"yargs/yargs";var O={name:"@cyberskill/shared",type:"module",version:"1.137.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./configs":{types:"./dist/configs/index.d.ts",import:"./dist/configs/index.js",require:"./dist/configs/index.cjs"},"./configs/commitlint":{types:"./dist/configs/commitlint/index.d.ts",import:"./dist/configs/commitlint/index.js",require:"./dist/configs/commitlint/index.cjs"},"./configs/env":{types:"./dist/configs/env/index.d.ts",import:"./dist/configs/env/index.js",require:"./dist/configs/env/index.cjs"},"./configs/eslint":{types:"./dist/configs/eslint/index.d.ts",import:"./dist/configs/eslint/index.js",require:"./dist/configs/eslint/index.cjs"},"./configs/graphql-codegen":{types:"./dist/configs/graphql-codegen/index.d.ts",import:"./dist/configs/graphql-codegen/index.js",require:"./dist/configs/graphql-codegen/index.cjs"},"./configs/lint-staged":{types:"./dist/configs/lint-staged/index.d.ts",import:"./dist/configs/lint-staged/index.js",require:"./dist/configs/lint-staged/index.cjs"},"./constants":{types:"./dist/constants/index.d.ts",import:"./dist/constants/index.js",require:"./dist/constants/index.cjs"},"./node":{types:"./dist/node/index.d.ts",import:"./dist/node/index.js",require:"./dist/node/index.cjs"},"./node/apollo-server":{types:"./dist/node/apollo-server/index.d.ts",import:"./dist/node/apollo-server/index.js",require:"./dist/node/apollo-server/index.cjs"},"./node/cli":{types:"./dist/node/cli/index.d.ts",import:"./dist/node/cli/index.js",require:"./dist/node/cli/index.cjs"},"./node/command":{types:"./dist/node/command/index.d.ts",import:"./dist/node/command/index.js",require:"./dist/node/command/index.cjs"},"./node/express":{types:"./dist/node/express/index.d.ts",import:"./dist/node/express/index.js",require:"./dist/node/express/index.cjs"},"./node/fs":{types:"./dist/node/fs/index.d.ts",import:"./dist/node/fs/index.js",require:"./dist/node/fs/index.cjs"},"./node/log":{types:"./dist/node/log/index.d.ts",import:"./dist/node/log/index.js",require:"./dist/node/log/index.cjs"},"./node/mongo":{types:"./dist/node/mongo/index.d.ts",import:"./dist/node/mongo/index.js",require:"./dist/node/mongo/index.cjs"},"./node/package":{types:"./dist/node/package/index.d.ts",import:"./dist/node/package/index.js",require:"./dist/node/package/index.cjs"},"./node/path":{types:"./dist/node/path/index.d.ts",import:"./dist/node/path/index.js",require:"./dist/node/path/index.cjs"},"./node/storage":{types:"./dist/node/storage/index.d.ts",import:"./dist/node/storage/index.js",require:"./dist/node/storage/index.cjs"},"./node/ws":{types:"./dist/node/ws/index.d.ts",import:"./dist/node/ws/index.js",require:"./dist/node/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./styles/reset.css":{import:"./dist/styles/reset.css",require:"./dist/styles/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./utils":{types:"./dist/utils/index.d.ts",import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"}},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{cyberskill:"dist/node/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"tsup --watch",lint:"tsx src/node/cli/index.ts lint","lint:fix":"tsx src/node/cli/index.ts lint:fix","lint:inspect":"tsx src/node/cli/index.ts lint:inspect",reset:"tsx src/node/cli/index.ts reset",prepare:"tsx src/node/cli/index.ts prepare",inspect:"tsx src/node/cli/index.ts inspect","test:unit":"tsx src/node/cli/index.ts test:unit","test:e2e":"tsx src/node/cli/index.ts test:e2e",commitlint:"tsx src/node/cli/index.ts commitlint"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@dotenvx/dotenvx":"1.42.2","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.5","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.7","@nestjs/common":"11.1.0","@nestjs/core":"11.1.0","@next/eslint-plugin-next":"15.3.1","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.9.0","@vitest/browser":"3.1.2","body-parser":"2.2.0",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2","cookie-parser":"1.4.7",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0","dotenv-cli":"8.0.0",envalid:"8.0.0","eslint-config-next":"15.3.1","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20",express:"4.21.2","express-session":"1.18.1","express-useragent":"1.0.15","fs-extra":"11.3.0",globals:"16.0.0",graphql:"16.11.0","graphql-ws":"6.0.4",i18next:"25.0.2",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3","modern-normalize":"3.0.1",mongodb:"6.16.0",mongoose:"8.14.1","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.1.0","node-fetch":"3.3.2","node-persist":"4.0.4",playwright:"1.52.0","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.5.1","react-icons":"5.5.0",sass:"1.87.0",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.4",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.4",vitest:"3.1.2","vitest-browser-react":"0.1.1",ws:"8.18.1",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@commitlint/config-conventional":"19.8.0","@eslint/config-inspector":"1.0.2","@types/body-parser":"1.19.5","@types/compression":"1.7.5","@types/cookie-parser":"1.4.8","@types/cors":"2.8.17","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.1","@types/express-useragent":"1.0.5","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node":"22.15.3","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.3","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.26.0","lint-staged":"15.5.1","node-modules-inspector":"0.6.7","simple-git-hooks":"2.13.0"}};var C=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});import{exec as I}from"node:child_process";import N from"node:process";import*as T from"node:util";var x=".cyberskill-storage";import A from"@dotenvx/dotenvx";import{bool as _,cleanEnv as R,str as b}from"envalid";import G from"node:os";import P from"node:path";import M from"node:process";var w=!1;function L(){w||(A.config(),w=!0)}h(L,"loadEnvFile");function j(){L();var e=R(M.env,{CWD:b({default:M.cwd()}),DEBUG:_({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:b({default:P.join(G.homedir(),x)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}h(j,"getEnv");var k=function(e){return e.Error="error",e.Warning="warning",e}({});import U from"chalk";import F from"consola";import{GraphQLError as q}from"graphql";var Y={GRAPHQL_PARSE_FAILED:{CODE:"GRAPHQL_PARSE_FAILED",MESSAGE:"The GraphQL operation string contains a syntax error."},GRAPHQL_VALIDATION_FAILED:{CODE:"GRAPHQL_VALIDATION_FAILED",MESSAGE:"The GraphQL operation is not valid against the server's schema."},BAD_USER_INPUT:{CODE:"BAD_USER_INPUT",MESSAGE:"The GraphQL operation includes an invalid value for a field argument."},PERSISTED_QUERY_NOT_FOUND:{CODE:"PERSISTED_QUERY_NOT_FOUND",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the query was not in the APQ cache."},PERSISTED_QUERY_NOT_SUPPORTED:{CODE:"PERSISTED_QUERY_NOT_SUPPORTED",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the server has disabled APQ."},OPERATION_RESOLUTION_FAILURE:{CODE:"OPERATION_RESOLUTION_FAILURE",MESSAGE:"The request was parsed successfully and is valid against the server's schema, but the server couldn't resolve which operation to run. This occurs when a request containing multiple named operations doesn't specify which operation to run (i.e.,operationName), or if the named operation isn't included in the request."},CONTINUE:{CODE:100,MESSAGE:"Continue"},SWITCHING_PROTOCOLS:{CODE:101,MESSAGE:"Switching Protocols"},PROCESSING:{CODE:102,MESSAGE:"Processing"},OK:{CODE:200,MESSAGE:"OK"},CREATED:{CODE:201,MESSAGE:"Created"},ACCEPTED:{CODE:202,MESSAGE:"Accepted"},NON_AUTHORITATIVE_INFORMATION:{CODE:203,MESSAGE:"Non Authoritative Information"},NO_CONTENT:{CODE:204,MESSAGE:"No Content"},RESET_CONTENT:{CODE:205,MESSAGE:"Reset Content"},PARTIAL_CONTENT:{CODE:206,MESSAGE:"Partial Content"},MULTI_STATUS:{CODE:207,MESSAGE:"Multi-Status"},MULTIPLE_CHOICES:{CODE:300,MESSAGE:"Multiple Choices"},MOVED_PERMANENTLY:{CODE:301,MESSAGE:"Moved Permanently"},MOVED_TEMPORARILY:{CODE:302,MESSAGE:"Moved Temporarily"},SEE_OTHER:{CODE:303,MESSAGE:"See Other"},NOT_MODIFIED:{CODE:304,MESSAGE:"Not Modified"},USE_PROXY:{CODE:305,MESSAGE:"Use Proxy"},TEMPORARY_REDIRECT:{CODE:307,MESSAGE:"Temporary Redirect"},PERMANENT_REDIRECT:{CODE:308,MESSAGE:"Permanent Redirect"},BAD_REQUEST:{CODE:400,MESSAGE:"Bad Request"},UNAUTHORIZED:{CODE:401,MESSAGE:"Unauthorized"},PAYMENT_REQUIRED:{CODE:402,MESSAGE:"Payment Required"},FORBIDDEN:{CODE:403,MESSAGE:"Forbidden"},NOT_FOUND:{CODE:404,MESSAGE:"Not Found"},METHOD_NOT_ALLOWED:{CODE:405,MESSAGE:"Method Not Allowed"},NOT_ACCEPTABLE:{CODE:406,MESSAGE:"Not Acceptable"},PROXY_AUTHENTICATION_REQUIRED:{CODE:407,MESSAGE:"Proxy Authentication Required"},REQUEST_TIMEOUT:{CODE:408,MESSAGE:"Request Timeout"},CONFLICT:{CODE:409,MESSAGE:"Conflict"},GONE:{CODE:410,MESSAGE:"Gone"},LENGTH_REQUIRED:{CODE:411,MESSAGE:"Length Required"},PRECONDITION_FAILED:{CODE:412,MESSAGE:"Precondition Failed"},REQUEST_TOO_LONG:{CODE:413,MESSAGE:"Request Entity Too Large"},REQUEST_URI_TOO_LONG:{CODE:414,MESSAGE:"Request-URI Too Long"},UNSUPPORTED_MEDIA_TYPE:{CODE:415,MESSAGE:"Unsupported Media Type"},REQUESTED_RANGE_NOT_SATISFIABLE:{CODE:416,MESSAGE:"Requested Range Not Satisfiable"},EXPECTATION_FAILED:{CODE:417,MESSAGE:"Expectation Failed"},IM_A_TEAPOT:{CODE:418,MESSAGE:"I'm a teapot"},INSUFFICIENT_SPACE_ON_RESOURCE:{CODE:419,MESSAGE:"Insufficient Space on Resource"},METHOD_FAILURE:{CODE:420,MESSAGE:"Method Failure"},MISDIRECTED_REQUEST:{CODE:421,MESSAGE:"Misdirected Request"},UNPROCESSABLE_ENTITY:{CODE:422,MESSAGE:"Unprocessable Entity"},LOCKED:{CODE:423,MESSAGE:"Locked"},FAILED_DEPENDENCY:{CODE:424,MESSAGE:"Failed Dependency"},PRECONDITION_REQUIRED:{CODE:428,MESSAGE:"Precondition Required"},TOO_MANY_REQUESTS:{CODE:429,MESSAGE:"Too Many Requests"},REQUEST_HEADER_FIELDS_TOO_LARGE:{CODE:431,MESSAGE:"Request Header Fields Too Large"},UNAVAILABLE_FOR_LEGAL_REASONS:{CODE:451,MESSAGE:"Unavailable For Legal Reasons"},INTERNAL_SERVER_ERROR:{CODE:500,MESSAGE:"Internal Server Error"},NOT_IMPLEMENTED:{CODE:501,MESSAGE:"Not Implemented"},BAD_GATEWAY:{CODE:502,MESSAGE:"Bad Gateway"},SERVICE_UNAVAILABLE:{CODE:503,MESSAGE:"Service Unavailable"},GATEWAY_TIMEOUT:{CODE:504,MESSAGE:"Gateway Timeout"},HTTP_VERSION_NOT_SUPPORTED:{CODE:505,MESSAGE:"HTTP Version Not Supported"},INSUFFICIENT_STORAGE:{CODE:507,MESSAGE:"Insufficient Storage"},NETWORK_AUTHENTICATION_REQUIRED:{CODE:511,MESSAGE:"Network Authentication Required"}};var V=j();V.DEBUG||(F.level=4);function B(e){var t=U[e];return typeof t=="function"?t:U.green}h(B,"chalkKeyword");var K={silent:F.silent,level:F.level,fatal:F.fatal,error:F.error,warn:F.warn,log:F.log,info:F.info,success:F.success,ready:F.ready,start:F.start,box:F.box,debug:F.debug,trace:F.trace,verbose:F.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){F.box(U.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;F.log("".concat(U.gray("File:")," ").concat(U.blue("".concat(t).concat(r?":".concat(r):"")))),s&&F.log(" ".concat(B(n)("Rule:")," ").concat(s)),F.log(" ".concat(B(n)("Message:")," ").concat(i))}),F.box(B(n)("".concat(e," : ").concat(t.length))),F.log(U.gray("─".repeat(40)))}};function H(e,t){var n=t!==null&&t!==void 0?t:{},r=n.shouldLog,s=r===void 0?!0:r,i=n.returnValue,a=n.callback,c=o(e,Error)?e:new Error(typeof e=="string"?e:"Unknown error");return s&&K.error(c.message),a&&typeof a=="function"&&a(c),i||{success:!1,message:c.message,code:Y.INTERNAL_SERVER_ERROR.CODE}}h(H,"catchErrorNode");var Q=function(e){return e.DEPENDENCY="dependencies",e.DEV_DEPENDENCY="devDependencies",e.PEER_DEPENDENCY="peerDependencies",e.BUNDLE_DEPENDENCY="bundleDependencies",e.OPTIONAL_DEPENDENCY="optionalDependencies",e}({});import W from"node-fetch";import J from"fs-extra";var z=J.lstatSync,$=J.readdirSync,X=J.mkdirSync,Z=J.readFileSync,ee=J.unlinkSync,et=J.statSync,en=J.readJsonSync;function er(e,t,n){J.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}h(er,"writeFileSync");function es(e,t,n){J.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}h(es,"appendFileSync");function ei(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return J.pathExistsSync(e)})}h(ei,"pathExistsSync");function eo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){ei(e)&&J.removeSync(e)})}h(eo,"removeSync");import ea from"fs-extra";import ec from"node:path";var eu=j(),el=ec;function ed(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=el).resolve.apply(r,[eu.CWD].concat(E(t)))}h(ed,"resolveWorkingPath");function ep(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=el).join.apply(r,E(t))}h(ep,"join");var eE=j(),ef=eE.CWD,em="@cyberskill/shared",eg="node_modules",ey="dist",eh="package.json",eS="package-lock.json",ev="tsconfig.json",eD=".gitignore",eO=".simple-git-hooks.json",eC="pnpm-lock.yaml",eI=".git/hooks/",eN=".git/COMMIT_EDITMSG",eT=".migrate-mongo.config.js",ex=function(){var e=ea.readJsonSync(ed(eh)).name===em?ef:ep(ef,eg,em);return ep(e,ey)}(),eA="cyberskill",e_="src/node/cli/index.ts",eR="eslint",eb="eslint",eG="vitest";var eP="vitest",eM="@commitlint/cli",ew="@commitlint/config-conventional",eL="commitlint",ej="lint-staged",ek="lint-staged",eU="typescript",eF="tsc",eq="tsx",eY="git",eV="pnpm",eB="pnpm exec",eK="simple-git-hooks",eH="simple-git-hooks",eQ="@eslint/config-inspector",eW="eslint-config-inspector",eJ="node-modules-inspector",ez="node-modules-inspector",e$="migrate-mongo",eX="./node_modules/migrate-mongo/bin/migrate-mongo",eZ={CYBERSKILL_DIRECTORY:ex,WORKING_DIRECTORY:ef,TS_CONFIG:ed(ev),GIT_IGNORE:ed(eD),GIT_HOOK:ed(eI),GIT_COMMIT_MSG:ed(eN),SIMPLE_GIT_HOOKS_JSON:ed(eO),PACKAGE_JSON:ed(eh),PACKAGE_LOCK_JSON:ed(eS),PNPM_LOCK_YAML:ed(eC),NODE_MODULES:ed(eg),MIGRATE_MONGO_CONFIG:ed(eT),LINT_STAGED_CONFIG:ed("".concat(ex,"/configs/lint-staged/index.js")),COMMITLINT_CONFIG:ed("".concat(ex,"/configs/commitlint/index.js")),UNIT_TEST_CONFIG:ed("".concat(ex,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:ed("".concat(ex,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:ed("".concat(ex,"/react/vitest/vitest.e2e.js"))};function e0(e){var t=e.isCurrentProject;return d({"pre-commit":ek,"commit-msg":eL},t&&{"pre-push":tp("".concat(eY," pull"))})}h(e0,"createGitHooksConfig");function e1(e){var t=e.type,n=e.packages,r=e.command;var i=n===null||n===void 0?void 0:n.reduce(function(e,t){return e.some(function(e){return e.name===t.name})||e.push(t),e},[]);return function(){return s(function(){var e;return g(this,function(n){switch(n.label){case 0:switch(t){case C.CLI:return[3,1];case C.STRING:return[3,4]}return[3,5];case 1:e=i===null||i===void 0?void 0:i.length;if(!e)return[3,3];return[4,e7(i,{update:!0})];case 2:e=n.sent();n.label=3;case 3:return[2,(e,tf(tp("".concat(eB," ").concat(r))))];case 4:return[2,tf(tp(r))];case 5:throw new Error("Unsupported command type");case 6:return[2]}})})()}}h(e1,"buildCommand");var e2={simpleGitHooks:e1({type:C.CLI,packages:[{name:eK,type:Q.DEV_DEPENDENCY}],command:eH}),eslintInspect:e1({type:C.CLI,packages:[{name:eQ,type:Q.DEV_DEPENDENCY}],command:eW}),nodeModulesInspect:e1({type:C.CLI,packages:[{name:eJ,type:Q.DEV_DEPENDENCY}],command:ez}),eslintCheck:e1({type:C.CLI,packages:[{name:eR,type:Q.DEV_DEPENDENCY}],command:"".concat(eb," ").concat(eZ.WORKING_DIRECTORY," --no-cache")}),eslintFix:e1({type:C.CLI,packages:[{name:eR,type:Q.DEV_DEPENDENCY}],command:"".concat(eb," ").concat(eZ.WORKING_DIRECTORY," --fix --no-cache")}),typescriptCheck:e1({type:C.CLI,packages:[{name:eU,type:Q.DEPENDENCY}],command:"".concat(eF," -p ").concat(eZ.TS_CONFIG," --noEmit")}),testUnit:e1({type:C.CLI,packages:[{name:eG,type:Q.DEV_DEPENDENCY}],command:"".concat(eP," --config ").concat(eZ.UNIT_TEST_CONFIG)}),testE2e:e1({type:C.CLI,packages:[{name:eG,type:Q.DEV_DEPENDENCY}],command:"".concat(eP," --config ").concat(eZ.E2E_TEST_CONFIG)}),mongoMigrateCreate:h(function(e){return e1({type:C.CLI,packages:[{name:e$,type:Q.DEPENDENCY}],command:"".concat(eq," ").concat(eX," create ").concat(e," -f ").concat(eZ.MIGRATE_MONGO_CONFIG)})()},"mongoMigrateCreate"),mongoMigrateUp:e1({type:C.CLI,packages:[{name:e$,type:Q.DEPENDENCY}],command:"".concat(eq," ").concat(eX," up -f ").concat(eZ.MIGRATE_MONGO_CONFIG)}),mongoMigrateDown:e1({type:C.CLI,packages:[{name:e$,type:Q.DEPENDENCY}],command:"".concat(eq," ").concat(eX," down -f ").concat(eZ.MIGRATE_MONGO_CONFIG)}),commitLint:e1({type:C.CLI,packages:[{name:eM,type:Q.DEV_DEPENDENCY},{name:ew,type:Q.DEV_DEPENDENCY}],command:"".concat(eL," --edit ").concat(eZ.GIT_COMMIT_MSG," --config ").concat(eZ.COMMITLINT_CONFIG)}),lintStaged:e1({type:C.CLI,packages:[{name:ej,type:Q.DEV_DEPENDENCY}],command:"".concat(ek," --config ").concat(eZ.LINT_STAGED_CONFIG)}),configureGitHook:e1({type:C.STRING,command:"".concat(eY," config core.hooksPath ").concat(eZ.GIT_HOOK)}),stageBuildDirectory:e1({type:C.STRING,command:"".concat(eY," add ").concat(ey)}),build:e1({type:C.STRING,command:"".concat(eV," run --if-present build")}),pnpmInstallStandard:e1({type:C.STRING,command:"".concat(eV," install --no-frozen-lockfile")}),pnpmInstallLegacy:e1({type:C.STRING,command:"".concat(eV," install --no-frozen-lockfile --legacy-peer-deps")}),pnpmInstallForce:e1({type:C.STRING,command:"".concat(eV," install --no-frozen-lockfile --force")})};var e4=j();function e3(e){return s(function(){var t,n,r,s;return g(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,W("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=i.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=i.sent(),r=n.version;return[2,{success:!0,result:r}];case 3:s=i.sent();return[2,H(s)];case 4:return[2]}})})()}h(e3,"getLatestPackageVersion");function e5(e){return s(function(){var t,n,r,s,i,o,a,c,u,l,d,p,E,f,m,y,h,S,v;return g(this,function(g){switch(g.label){case 0:g.trys.push([0,2,,3]);if(!ei(eZ.PACKAGE_JSON))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===Q.DEPENDENCY,isDevDependency:e.type===Q.DEV_DEPENDENCY,installedPath:"",file:{}}}];t=en(eZ.PACKAGE_JSON),n=t.name,r=t.version,s=r===void 0?"":r,i=t.dependencies,o=i===void 0?{}:i,a=t.devDependencies,c=a===void 0?{}:a;if(e.name===n)return[2,{success:!0,result:{name:n,currentVersion:s,latestVersion:s,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:e.type===Q.DEPENDENCY,isDevDependency:e.type===Q.DEV_DEPENDENCY,installedPath:eZ.PACKAGE_JSON,file:t}}];u=e.name in o,l=e.name in c;return[4,e3(e.name)];case 1:d=g.sent();if(!d.success)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:u,isDevDependency:l,installedPath:"",file:{}}}];if(!u&&!l)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:d.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===Q.DEPENDENCY,isDevDependency:e.type===Q.DEV_DEPENDENCY,installedPath:"",file:{}}}];f=(E=(p=o[e.name])!==null&&p!==void 0?p:c[e.name])!==null&&E!==void 0?E:"",m=ep(e4.CWD,eg,e.name,eh);if(!ei(m))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:d.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:u,isDevDependency:l,installedPath:"",file:{}}}];y=en(m),h=y.version,S=h===void 0?"":h;return[2,f!==S?{success:!0,result:{name:e.name,currentVersion:S||f,latestVersion:d.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:!1,isDependency:u,isDevDependency:l,installedPath:m,file:y}}:{success:!0,result:{name:e.name,currentVersion:f,latestVersion:d.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:f===d.result,isDependency:u,isDevDependency:l,installedPath:m,file:y}}];case 2:v=g.sent();return[2,H(v)];case 3:return[2]}})})()}h(e5,"getPackage");function e8(e){return s(function(){var t,n,r,s,i;return g(this,function(o){try{;r=en(eZ.PACKAGE_JSON),s=(t=r.dependencies)!==null&&t!==void 0?t:{},i=(n=r.devDependencies)!==null&&n!==void 0?n:{};e.isDependency?s[e.name]=e.latestVersion:e.isDevDependency&&(i[e.name]=e.latestVersion),er(eZ.PACKAGE_JSON,JSON.stringify(r,null,4)),K.info('Updated "'.concat(e.name,'" to version ').concat(e.latestVersion))}catch(e){H(e)}return[2]})})()}h(e8,"updatePackage");function e6(){return s(function(){var e,t,n,r,s,i,o,a,c,u,l,d,p;return g(this,function(E){switch(E.label){case 0:E.trys.push([0,12,,13]);e=[{command:h(function(){return e2.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:h(function(){return e2.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:h(function(){return e2.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;E.label=1;case 1:E.trys.push([1,9,10,11]);s=e[Symbol.iterator]();E.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,8];o=i.value,a=o.command,c=o.message;E.label=3;case 3:E.trys.push([3,6,,7]);return[4,a()];case 4:u=E.sent();return[4,tg("".concat(c," using: ").concat(u),u)];case 5:E.sent();return[2];case 6:l=E.sent();H(l);return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=E.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}return[7];case 11:return[3,13];case 12:p=E.sent();H(p);return[3,13];case 13:return[2]}})})()}h(e6,"installDependencies");function e7(e,t){return s(function(){var n,r,s,i,o,a,c,u,l,d,p,E;return g(this,function(f){switch(f.label){case 0:if(!ei(eZ.PACKAGE_JSON)){K.error("package.json not found. Aborting setup.");return[2]}f.label=1;case 1:f.trys.push([1,16,,17]);return[4,Promise.all(e.map(e5))];case 2:n=f.sent().filter(function(e){return e.success?!e.result.isCurrentProject&&(!e.result.isInstalled||!e.result.isUpToDate):!1});r=n.length>0;if(!r)return[3,7];return[4,Promise.all(n.map(function(e){return e.success?e8(e.result):Promise.resolve()}))];case 3:f.sent();return[4,e6()];case 4:f.sent();s=["Running ESLint with auto-fix"];return[4,e2.eslintFix()];case 5:return[4,tg.apply(void 0,s.concat([f.sent()]))];case 6:r=f.sent();f.label=7;case 7:r;o=true,a=false,c=undefined;f.label=8;case 8:f.trys.push([8,13,14,15]);u=((i=t===null||t===void 0?void 0:t.postInstallActions)!==null&&i!==void 0?i:[])[Symbol.iterator]();f.label=9;case 9:if(!!(o=(l=u.next()).done))return[3,12];d=l.value;return[4,d()];case 10:f.sent();f.label=11;case 11:o=true;return[3,9];case 12:return[3,15];case 13:p=f.sent();a=true;c=p;return[3,15];case 14:try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw c}}return[7];case 15:return[3,17];case 16:E=f.sent();H(E);return[3,17];case 17:return[2]}})})()}h(e7,"setupPackages");import e9 from"node-persist";var te=j();function tt(){return s(function(){var e;return g(this,function(t){switch(t.label){case 0:e=e9.defaultInstance;if(e)return[3,2];return[4,e9.init({dir:te.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}h(tt,"initNodePersist");var tn={get:function e(e){return s(function(){var t,n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tt()];case 1:r.sent();return[4,e9.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,H(n,{returnValue:null})];case 4:return[2]}})})()},set:function e(e,t){return s(function(){var n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tt()];case 1:r.sent();return[4,e9.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();H(n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return s(function(){var t;return g(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tt()];case 1:n.sent();return[4,e9.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();H(t);return[3,4];case 4:return[2]}})})()},keys:function e(){return s(function(){var e,t;return g(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tt()];case 1:n.sent();return[4,e9.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(K.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,H(t,{returnValue:[]})];case 4:return[2]}})})()},getLogLink:function e(e){return s(function(){return g(this,function(t){try{return[2,"".concat(te.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,H(e,{returnValue:null})]}return[2]})})()}};var tr=j(),ts=T.promisify(I);function ti(e){return"error_list:".concat(e)}h(ti,"getErrorListKey");function to(e){return s(function(){var t,n,r;return g(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];t=Date.now(),n=ti(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,tn.set(n,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(function(){return s(function(){var e;return g(this,function(t){switch(t.label){case 0:return[4,tn.getLogLink(n)];case 1:e=t.sent();e&&K.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},10);return[3,4];case 3:r=i.sent();H(r);return[3,4];case 4:return[2]}})})()}h(to,"saveErrorListToStorage");function ta(){return s(function(){var e,t,n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tn.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return s(function(){var t;return g(this,function(n){switch(n.label){case 0:return[4,tn.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})})()}))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,H(n,{returnValue:[]})];case 4:return[2]}})})()}h(ta,"getStoredErrorLists");function tc(){return s(function(){var e,t,n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tn.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return tn.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();H(n);return[3,4];case 4:return[2]}})})()}h(tc,"clearAllErrorLists");function tu(e){var t=[],n=[],r="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var a,c,u,l,d;var p=s.exec(e)||[],E=i.exec(e)||[],f=o.exec(e)||[];var m,g,y,h,S,v;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===k.Error?k.Error:k.Warning,message:(m=p===null||p===void 0?void 0:(a=p[4])===null||a===void 0?void 0:a.trim())!==null&&m!==void 0?m:"",rule:(g=p===null||p===void 0?void 0:(c=p[5])===null||c===void 0?void 0:c.trim())!==null&&g!==void 0?g:""}):E.length?t.push({file:(y=E===null||E===void 0?void 0:E[1])!==null&&y!==void 0?y:"",position:"".concat(E[2],":").concat(E[3]),type:E[4]===k.Error?k.Error:k.Warning,message:(h=E===null||E===void 0?void 0:(u=E[5])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:""}):f.length?t.push({file:"commitlint",type:k.Error,message:(S=f===null||f===void 0?void 0:(l=f[1])===null||l===void 0?void 0:l.trim())!==null&&S!==void 0?S:"",rule:(v=f===null||f===void 0?void 0:(d=f[2])===null||d===void 0?void 0:d.trim())!==null&&v!==void 0?v:""}):n.push(e.trim())}}),t.length&&to(t),tr.DEBUG&&n.length&&(K.warn("Unmatched lines:"),n.forEach(function(e){return K.info(" ".concat(e))}))}h(tu,"parseTextErrors");function tl(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,s=e.line,i=e.column,o=e.ruleId,a=e.message;n.push({type:r===2?k.Error:k.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:a})})}),n.length&&to(n)}catch(t){tu(e)}}h(tl,"parseCommandOutput");function td(e){return s(function(e){var t,n,r,s,i,o,a,c,u;var l=arguments;return g(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tl;n=new AbortController;N.on("SIGINT",function(){K.warn("Process interrupted. Terminating..."),n.abort(),N.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,ts(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),s=r.stdout,i=r.stderr;[s,i].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:o=d.sent();a=o.stdout,c=o.stderr,u=o.message;[a,c].forEach(function(e){return e&&t(e)}),!c&&!a&&K.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}h(td,"executeCommand");function tp(e){return{raw:!0,cmd:e}}h(tp,"rawCommand");function tE(e,t){return(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eB," ").concat(eq," ").concat(e_," ").concat(e):"".concat(eB," ").concat(eA," ").concat(e)}h(tE,"formatCLI");function tf(e,t){return typeof e=="function"?tE(e(t),t):(typeof e==="undefined"?"undefined":f(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tE(e,t):e}h(tf,"formatCommand");function tm(e){return s(function(){var t,n,r;return g(this,function(s){switch(s.label){case 0:return[4,e5({name:em})];case 1:t=s.sent();if(t.success){n={isCurrentProject:t.result.isCurrentProject},r=typeof e=="function"?e(n):e;return[2,Object.fromEntries(Object.entries(r).map(function(e){var t=p(e,2),r=t[0],s=t[1];return[r,tf(s,n)]}))]}return[2]}})})()}h(tm,"resolveCommands");function tg(e,t){return s(function(){var n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);K.start("".concat(e)),tr.DEBUG&&K.info("→ ".concat(t));return[4,td(t)];case 1:r.sent(),K.success("".concat(e," done."));return[3,3];case 2:n=r.sent();H(n);return[3,3];case 3:return[2]}})})()}h(tg,"runCommand");function ty(){return s(function(){var e,t;return g(this,function(n){switch(n.label){case 0:if(!ei(eZ.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,e2.typescriptCheck()];case 1:return[4,tg.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=K.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}h(ty,"checkTypescript");function th(){return s(function(){var e,t,n,r;var s=arguments;return g(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,e2.eslintFix()];case 1:return[4,tg.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,e2.eslintCheck()];case 4:return[4,tg.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})}).apply(this,arguments)}h(th,"checkEslint");function tS(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";K.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}h(tS,"printIssues");function tv(){return s(function(){var e,t,n;return g(this,function(r){switch(r.label){case 0:return[4,ta()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===k.Error}),n=e.filter(function(e){return e.type===k.Warning});!t.length&&!n.length?K.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tS("Warnings",n),tS("Errors",t),(t.length>0||n.length>0)&&S.exit(1));return[2]}})})()}h(tv,"showCheckResult");function tD(){return s(function(){var e,t,n,r,s;return g(this,function(i){switch(i.label){case 0:return[4,tc()];case 1:i.sent();return[4,e5({name:em})];case 2:e=i.sent();if(!e.success){K.error("Failed to retrieve package information. Aborting lint-staged.");return[2]}t=e.result.isCurrentProject;if(!t)return[3,7];n=["Building package: ".concat(em)];return[4,e2.build()];case 3:return[4,tg.apply(void 0,n.concat([i.sent()]))];case 4:i.sent();r=["Staging build artifacts"];return[4,e2.stageBuildDirectory()];case 5:return[4,tg.apply(void 0,r.concat([i.sent()]))];case 6:t=i.sent();i.label=7;case 7:t;s=["Executing lint-staged"];return[4,e2.lintStaged()];case 8:return[4,tg.apply(void 0,s.concat([i.sent()]))];case 9:i.sent(),tv();return[2]}})})()}h(tD,"lintStaged");function tO(){return s(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,e2.eslintInspect()];case 1:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(tO,"inspectLint");function tC(){return s(function(){return g(this,function(e){switch(e.label){case 0:return[4,tc()];case 1:e.sent();return[4,Promise.all([ty(),th()])];case 2:e.sent(),tv();return[2]}})})()}h(tC,"lintCheck");function tI(){return s(function(){return g(this,function(e){switch(e.label){case 0:return[4,tc()];case 1:e.sent();return[4,Promise.all([ty(),th(!0)])];case 2:e.sent(),tv();return[2]}})})()}h(tI,"lintFix");function tN(){return s(function(){var e;return g(this,function(t){switch(t.label){case 0:return[4,tc()];case 1:t.sent();e=["Validating commit message"];return[4,e2.commitLint()];case 2:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tv();return[2]}})})()}h(tN,"commitLint");function tT(){return s(function(){var e,t,n,r;return g(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,e2.configureGitHook()];case 1:return[4,tg.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),eo(eZ.GIT_HOOK);return[4,tm(e0)];case 3:t=s.sent();er(eZ.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));n="\n".concat(eO,"\n");ei(eZ.GIT_IGNORE)?Z(eZ.GIT_IGNORE,"utf-8").split("\n").includes(eO)||es(eZ.GIT_IGNORE,n):er(eZ.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,e2.simpleGitHooks()];case 4:return[4,tg.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})})()}h(tT,"setupGitHook");function tx(){return s(function(){return g(this,function(e){switch(e.label){case 0:return[4,e7([{name:em,type:Q.DEPENDENCY}],{update:!0,postInstallActions:[tT]})];case 1:e.sent();return[2]}})})()}h(tx,"prepare");function tA(){return s(function(){return g(this,function(e){switch(e.label){case 0:eo(eZ.NODE_MODULES,eZ.PNPM_LOCK_YAML);return[4,e6()];case 1:e.sent();return[4,tT()];case 2:e.sent();return[2]}})})()}h(tA,"reset");function t_(){return s(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,e2.nodeModulesInspect()];case 1:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(t_,"inspect");function tR(){return s(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,e2.testUnit()];case 1:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(tR,"testUnit");function tb(){return s(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,e2.testE2e()];case 1:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(tb,"testE2E");function tG(e){return s(function(){var t;return g(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,e2.mongoMigrateCreate(e)];case 1:return[4,tg.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}h(tG,"mongoMigrateCreate");function tP(){return s(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,e2.mongoMigrateUp()];case 1:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(tP,"mongoMigrateUp");function tM(){return s(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,e2.mongoMigrateDown()];case 1:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(tM,"mongoMigrateDown");(function(){return s(function(){var e;return g(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,D(v(S.argv)).scriptName(eA).usage("$0 <command> [options]").command("lint","Check code for linting issues",tC).command("lint:fix","Fix linting issues automatically",tI).command("lint:inspect","View active ESLint configuration",tO).command("lint-staged","Run lint checks on staged files",tD).command("commitlint","Validate commit message format",tN).command("prepare","Initialize project and dependencies",tx).command("reset","Reset the project and reinstall dependencies",tA).command("inspect","Analyze installed project dependencies",t_).command("test:unit","Run unit test suite",tR).command("test:e2e","Run end-to-end test suite",tb).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},function(e){return s(function(){return g(this,function(t){switch(t.label){case 0:if(!e.name){K.error("Migration name is required.");return[2]}return[4,tG(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",tP).command("mongo:migrate:down","Rollback last MongoDB migration",tM).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(O.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();H(e),S.exit(1);return[3,3];case 3:return[2]}})})()})();
1
+ function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t,n,r,i,s,o){try{var a=e[s](o);var c=a.value}catch(e){n(e);return}if(a.done){t(c)}else{Promise.resolve(c).then(r,i)}}function i(e){return function(){var t=this,n=arguments;return new Promise(function(i,s){var o=e.apply(t,n);function a(e){r(o,i,s,a,c,"next",e)}function c(e){r(o,i,s,a,c,"throw",e)}a(undefined)})}}function s(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function o(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function a(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var i=true;var s=false;var o,a;try{for(n=n.call(e);!(i=(o=n.next()).done);i=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){s=true;a=e}finally{try{if(!i&&n["return"]!=null)n["return"]()}finally{if(s)throw a}}return r}function u(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){s(e,t,n[t])})}return e}function p(e,n){return t(e)||c(e,n)||m(e,n)||u()}function E(e){return n(e)||a(e)||m(e)||l()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function m(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function g(e,t){var n,r,i,s={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=a(0),o["throw"]=a(1),o["return"]=a(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return c([e,t])}}function c(a){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(s=0)),s)try{if(n=1,r&&(i=a[0]&2?r["return"]:a[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;if(r=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:s.label++;return{value:a[1],done:false};case 5:s.label++;r=a[1];a=[0];continue;case 7:a=s.ops.pop();s.trys.pop();continue;default:if(!(i=s.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){s=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(a[0]===6&&s.label<i[1]){s.label=i[1];i=a;break}if(i&&s.label<i[2]){s.label=i[2];s.ops.push(a);break}if(i[2])s.ops.pop();s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e];r=0}finally{n=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}var y=Object.defineProperty;var h=function(e,t){return y(e,"name",{value:t,configurable:!0})};import S from"node:process";import{hideBin as v}from"yargs/helpers";import D from"yargs/yargs";var O={name:"@cyberskill/shared",type:"module",version:"1.139.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./config":{types:"./dist/config/index.d.ts",import:"./dist/config/index.js",require:"./dist/config/index.cjs"},"./config/commitlint":{types:"./dist/config/commitlint/index.d.ts",import:"./dist/config/commitlint/index.js",require:"./dist/config/commitlint/index.cjs"},"./config/env":{types:"./dist/config/env/index.d.ts",import:"./dist/config/env/index.js",require:"./dist/config/env/index.cjs"},"./config/eslint":{types:"./dist/config/eslint/index.d.ts",import:"./dist/config/eslint/index.js",require:"./dist/config/eslint/index.cjs"},"./config/graphql-codegen":{types:"./dist/config/graphql-codegen/index.d.ts",import:"./dist/config/graphql-codegen/index.js",require:"./dist/config/graphql-codegen/index.cjs"},"./config/lint-staged":{types:"./dist/config/lint-staged/index.d.ts",import:"./dist/config/lint-staged/index.js",require:"./dist/config/lint-staged/index.cjs"},"./constant":{types:"./dist/constant/index.d.ts",import:"./dist/constant/index.js",require:"./dist/constant/index.cjs"},"./node":{types:"./dist/node/index.d.ts",import:"./dist/node/index.js",require:"./dist/node/index.cjs"},"./node/apollo-server":{types:"./dist/node/apollo-server/index.d.ts",import:"./dist/node/apollo-server/index.js",require:"./dist/node/apollo-server/index.cjs"},"./node/cli":{types:"./dist/node/cli/index.d.ts",import:"./dist/node/cli/index.js",require:"./dist/node/cli/index.cjs"},"./node/command":{types:"./dist/node/command/index.d.ts",import:"./dist/node/command/index.js",require:"./dist/node/command/index.cjs"},"./node/express":{types:"./dist/node/express/index.d.ts",import:"./dist/node/express/index.js",require:"./dist/node/express/index.cjs"},"./node/fs":{types:"./dist/node/fs/index.d.ts",import:"./dist/node/fs/index.js",require:"./dist/node/fs/index.cjs"},"./node/log":{types:"./dist/node/log/index.d.ts",import:"./dist/node/log/index.js",require:"./dist/node/log/index.cjs"},"./node/mongo":{types:"./dist/node/mongo/index.d.ts",import:"./dist/node/mongo/index.js",require:"./dist/node/mongo/index.cjs"},"./node/package":{types:"./dist/node/package/index.d.ts",import:"./dist/node/package/index.js",require:"./dist/node/package/index.cjs"},"./node/path":{types:"./dist/node/path/index.d.ts",import:"./dist/node/path/index.js",require:"./dist/node/path/index.cjs"},"./node/storage":{types:"./dist/node/storage/index.d.ts",import:"./dist/node/storage/index.js",require:"./dist/node/storage/index.cjs"},"./node/ws":{types:"./dist/node/ws/index.d.ts",import:"./dist/node/ws/index.js",require:"./dist/node/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./style/reset.css":{import:"./dist/style/reset.css",require:"./dist/style/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./util":{types:"./dist/util/index.d.ts",import:"./dist/util/index.js",require:"./dist/util/index.cjs"}},typesVersions:{"*":{config:["dist/config/index.d.ts"],constant:["dist/constant/index.d.ts"],node:["dist/node/index.d.ts"],react:["dist/react/index.d.ts"],typescript:["dist/typescript/index.d.ts"],util:["dist/util/index.d.ts"]}},bin:{cyberskill:"dist/node/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"tsup --watch",lint:"tsx src/node/cli/index.ts lint","lint:fix":"tsx src/node/cli/index.ts lint:fix","lint:inspect":"tsx src/node/cli/index.ts lint:inspect",reset:"tsx src/node/cli/index.ts reset",prepare:"tsx src/node/cli/index.ts prepare",inspect:"tsx src/node/cli/index.ts inspect","test:unit":"tsx src/node/cli/index.ts test:unit","test:e2e":"tsx src/node/cli/index.ts test:e2e",commitlint:"tsx src/node/cli/index.ts commitlint"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@dotenvx/dotenvx":"1.42.2","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.5","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.7","@nestjs/common":"11.1.0","@nestjs/core":"11.1.0","@next/eslint-plugin-next":"15.3.1","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.9.0","@vitest/browser":"3.1.2","body-parser":"2.2.0",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2","cookie-parser":"1.4.7",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0","dotenv-cli":"8.0.0",envalid:"8.0.0","eslint-config-next":"15.3.1","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20",express:"4.21.2","express-session":"1.18.1","express-useragent":"1.0.15","fs-extra":"11.3.0",globals:"16.0.0",graphql:"16.11.0","graphql-ws":"6.0.4",i18next:"25.0.2",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3","modern-normalize":"3.0.1",mongodb:"6.16.0",mongoose:"8.14.1","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.1.0","node-fetch":"3.3.2","node-persist":"4.0.4",playwright:"1.52.0","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.5.1","react-icons":"5.5.0",sass:"1.87.0",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.4",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.4",vitest:"3.1.2","vitest-browser-react":"0.1.1",ws:"8.18.2",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@commitlint/config-conventional":"19.8.0","@eslint/config-inspector":"1.0.2","@types/body-parser":"1.19.5","@types/compression":"1.7.5","@types/cookie-parser":"1.4.8","@types/cors":"2.8.17","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.1","@types/express-useragent":"1.0.5","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node":"22.15.3","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.3","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.26.0","lint-staged":"15.5.1","node-modules-inspector":"0.6.7","simple-git-hooks":"2.13.0"}};var C=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});import{exec as I}from"node:child_process";import N from"node:process";import*as T from"node:util";var x=".cyberskill-storage";import A from"@dotenvx/dotenvx";import{bool as _,cleanEnv as R,str as b}from"envalid";import G from"node:os";import P from"node:path";import M from"node:process";var w=!1;function L(){w||(A.config(),w=!0)}h(L,"loadEnvFile");function j(){L();var e=R(M.env,{CWD:b({default:M.cwd()}),DEBUG:_({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:b({default:P.join(G.homedir(),x)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}h(j,"getEnv");var k=function(e){return e.Error="error",e.Warning="warning",e}({});import U from"chalk";import F from"consola";import{GraphQLError as q}from"graphql";var Y={GRAPHQL_PARSE_FAILED:{CODE:"GRAPHQL_PARSE_FAILED",MESSAGE:"The GraphQL operation string contains a syntax error."},GRAPHQL_VALIDATION_FAILED:{CODE:"GRAPHQL_VALIDATION_FAILED",MESSAGE:"The GraphQL operation is not valid against the server's schema."},BAD_USER_INPUT:{CODE:"BAD_USER_INPUT",MESSAGE:"The GraphQL operation includes an invalid value for a field argument."},PERSISTED_QUERY_NOT_FOUND:{CODE:"PERSISTED_QUERY_NOT_FOUND",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the query was not in the APQ cache."},PERSISTED_QUERY_NOT_SUPPORTED:{CODE:"PERSISTED_QUERY_NOT_SUPPORTED",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the server has disabled APQ."},OPERATION_RESOLUTION_FAILURE:{CODE:"OPERATION_RESOLUTION_FAILURE",MESSAGE:"The request was parsed successfully and is valid against the server's schema, but the server couldn't resolve which operation to run. This occurs when a request containing multiple named operations doesn't specify which operation to run (i.e.,operationName), or if the named operation isn't included in the request."},CONTINUE:{CODE:100,MESSAGE:"Continue"},SWITCHING_PROTOCOLS:{CODE:101,MESSAGE:"Switching Protocols"},PROCESSING:{CODE:102,MESSAGE:"Processing"},OK:{CODE:200,MESSAGE:"OK"},CREATED:{CODE:201,MESSAGE:"Created"},ACCEPTED:{CODE:202,MESSAGE:"Accepted"},NON_AUTHORITATIVE_INFORMATION:{CODE:203,MESSAGE:"Non Authoritative Information"},NO_CONTENT:{CODE:204,MESSAGE:"No Content"},RESET_CONTENT:{CODE:205,MESSAGE:"Reset Content"},PARTIAL_CONTENT:{CODE:206,MESSAGE:"Partial Content"},MULTI_STATUS:{CODE:207,MESSAGE:"Multi-Status"},MULTIPLE_CHOICES:{CODE:300,MESSAGE:"Multiple Choices"},MOVED_PERMANENTLY:{CODE:301,MESSAGE:"Moved Permanently"},MOVED_TEMPORARILY:{CODE:302,MESSAGE:"Moved Temporarily"},SEE_OTHER:{CODE:303,MESSAGE:"See Other"},NOT_MODIFIED:{CODE:304,MESSAGE:"Not Modified"},USE_PROXY:{CODE:305,MESSAGE:"Use Proxy"},TEMPORARY_REDIRECT:{CODE:307,MESSAGE:"Temporary Redirect"},PERMANENT_REDIRECT:{CODE:308,MESSAGE:"Permanent Redirect"},BAD_REQUEST:{CODE:400,MESSAGE:"Bad Request"},UNAUTHORIZED:{CODE:401,MESSAGE:"Unauthorized"},PAYMENT_REQUIRED:{CODE:402,MESSAGE:"Payment Required"},FORBIDDEN:{CODE:403,MESSAGE:"Forbidden"},NOT_FOUND:{CODE:404,MESSAGE:"Not Found"},METHOD_NOT_ALLOWED:{CODE:405,MESSAGE:"Method Not Allowed"},NOT_ACCEPTABLE:{CODE:406,MESSAGE:"Not Acceptable"},PROXY_AUTHENTICATION_REQUIRED:{CODE:407,MESSAGE:"Proxy Authentication Required"},REQUEST_TIMEOUT:{CODE:408,MESSAGE:"Request Timeout"},CONFLICT:{CODE:409,MESSAGE:"Conflict"},GONE:{CODE:410,MESSAGE:"Gone"},LENGTH_REQUIRED:{CODE:411,MESSAGE:"Length Required"},PRECONDITION_FAILED:{CODE:412,MESSAGE:"Precondition Failed"},REQUEST_TOO_LONG:{CODE:413,MESSAGE:"Request Entity Too Large"},REQUEST_URI_TOO_LONG:{CODE:414,MESSAGE:"Request-URI Too Long"},UNSUPPORTED_MEDIA_TYPE:{CODE:415,MESSAGE:"Unsupported Media Type"},REQUESTED_RANGE_NOT_SATISFIABLE:{CODE:416,MESSAGE:"Requested Range Not Satisfiable"},EXPECTATION_FAILED:{CODE:417,MESSAGE:"Expectation Failed"},IM_A_TEAPOT:{CODE:418,MESSAGE:"I'm a teapot"},INSUFFICIENT_SPACE_ON_RESOURCE:{CODE:419,MESSAGE:"Insufficient Space on Resource"},METHOD_FAILURE:{CODE:420,MESSAGE:"Method Failure"},MISDIRECTED_REQUEST:{CODE:421,MESSAGE:"Misdirected Request"},UNPROCESSABLE_ENTITY:{CODE:422,MESSAGE:"Unprocessable Entity"},LOCKED:{CODE:423,MESSAGE:"Locked"},FAILED_DEPENDENCY:{CODE:424,MESSAGE:"Failed Dependency"},PRECONDITION_REQUIRED:{CODE:428,MESSAGE:"Precondition Required"},TOO_MANY_REQUESTS:{CODE:429,MESSAGE:"Too Many Requests"},REQUEST_HEADER_FIELDS_TOO_LARGE:{CODE:431,MESSAGE:"Request Header Fields Too Large"},UNAVAILABLE_FOR_LEGAL_REASONS:{CODE:451,MESSAGE:"Unavailable For Legal Reasons"},INTERNAL_SERVER_ERROR:{CODE:500,MESSAGE:"Internal Server Error"},NOT_IMPLEMENTED:{CODE:501,MESSAGE:"Not Implemented"},BAD_GATEWAY:{CODE:502,MESSAGE:"Bad Gateway"},SERVICE_UNAVAILABLE:{CODE:503,MESSAGE:"Service Unavailable"},GATEWAY_TIMEOUT:{CODE:504,MESSAGE:"Gateway Timeout"},HTTP_VERSION_NOT_SUPPORTED:{CODE:505,MESSAGE:"HTTP Version Not Supported"},INSUFFICIENT_STORAGE:{CODE:507,MESSAGE:"Insufficient Storage"},NETWORK_AUTHENTICATION_REQUIRED:{CODE:511,MESSAGE:"Network Authentication Required"}};var V=j();V.DEBUG||(F.level=4);function B(e){var t=U[e];return typeof t=="function"?t:U.green}h(B,"chalkKeyword");var K={silent:F.silent,level:F.level,fatal:F.fatal,error:F.error,warn:F.warn,log:F.log,info:F.info,success:F.success,ready:F.ready,start:F.start,box:F.box,debug:F.debug,trace:F.trace,verbose:F.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){F.box(U.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,i=e.rule,s=e.message;F.log("".concat(U.gray("File:")," ").concat(U.blue("".concat(t).concat(r?":".concat(r):"")))),i&&F.log(" ".concat(B(n)("Rule:")," ").concat(i)),F.log(" ".concat(B(n)("Message:")," ").concat(s))}),F.box(B(n)("".concat(e," : ").concat(t.length))),F.log(U.gray("─".repeat(40)))}};function H(e,t){var n=t!==null&&t!==void 0?t:{},r=n.shouldLog,i=r===void 0?!0:r,s=n.returnValue,a=n.callback,c=o(e,Error)?e:new Error(typeof e=="string"?e:"Unknown error");return i&&K.error(c.message),a&&typeof a=="function"&&a(c),s||{success:!1,message:c.message,code:Y.INTERNAL_SERVER_ERROR.CODE}}h(H,"catchError");var Q=function(e){return e.DEPENDENCY="dependencies",e.DEV_DEPENDENCY="devDependencies",e.PEER_DEPENDENCY="peerDependencies",e.BUNDLE_DEPENDENCY="bundleDependencies",e.OPTIONAL_DEPENDENCY="optionalDependencies",e}({});import W from"node-fetch";import J from"fs-extra";var z=J.lstatSync,$=J.readdirSync,X=J.mkdirSync,Z=J.readFileSync,ee=J.unlinkSync,et=J.statSync,en=J.readJsonSync;function er(e,t,n){J.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}h(er,"writeFileSync");function ei(e,t,n){J.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}h(ei,"appendFileSync");function es(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return J.pathExistsSync(e)})}h(es,"pathExistsSync");function eo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){es(e)&&J.removeSync(e)})}h(eo,"removeSync");import ea from"fs-extra";import ec from"node:path";var eu=j(),el=ec;function ed(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=el).resolve.apply(r,[eu.CWD].concat(E(t)))}h(ed,"resolveWorkingPath");function ep(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=el).join.apply(r,E(t))}h(ep,"join");var eE=j(),ef=eE.CWD,em="@cyberskill/shared",eg="node_modules",ey="dist",eh="package.json",eS="package-lock.json",ev="tsconfig.json",eD=".gitignore",eO=".simple-git-hooks.json",eC="pnpm-lock.yaml",eI=".git/hooks/",eN=".git/COMMIT_EDITMSG",eT=".migrate-mongo.config.js",ex=function(){var e=ea.readJsonSync(ed(eh)).name===em?ef:ep(ef,eg,em);return ep(e,ey)}(),eA="cyberskill",e_="src/node/cli/index.ts",eR="eslint",eb="eslint",eG="vitest";var eP="vitest",eM="@commitlint/cli",ew="@commitlint/config-conventional",eL="commitlint",ej="lint-staged",ek="lint-staged",eU="typescript",eF="tsc",eq="tsx",eY="git",eV="pnpm",eB="pnpm exec",eK="simple-git-hooks",eH="simple-git-hooks",eQ="@eslint/config-inspector",eW="eslint-config-inspector",eJ="node-modules-inspector",ez="node-modules-inspector",e$="migrate-mongo",eX="./node_modules/migrate-mongo/bin/migrate-mongo",eZ={CYBERSKILL_DIRECTORY:ex,WORKING_DIRECTORY:ef,TS_CONFIG:ed(ev),GIT_IGNORE:ed(eD),GIT_HOOK:ed(eI),GIT_COMMIT_MSG:ed(eN),SIMPLE_GIT_HOOKS_JSON:ed(eO),PACKAGE_JSON:ed(eh),PACKAGE_LOCK_JSON:ed(eS),PNPM_LOCK_YAML:ed(eC),NODE_MODULES:ed(eg),MIGRATE_MONGO_CONFIG:ed(eT),LINT_STAGED_CONFIG:ed("".concat(ex,"/config/lint-staged/index.js")),COMMITLINT_CONFIG:ed("".concat(ex,"/config/commitlint/index.js")),UNIT_TEST_CONFIG:ed("".concat(ex,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:ed("".concat(ex,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:ed("".concat(ex,"/react/vitest/vitest.e2e.js"))};function e0(e){var t=e.isCurrentProject;return d({"pre-commit":ek,"commit-msg":eL},t&&{"pre-push":tp("".concat(eY," pull"))})}h(e0,"createGitHooksConfig");function e1(e){var t=e.type,n=e.packages,r=e.command;var s=n===null||n===void 0?void 0:n.reduce(function(e,t){return e.some(function(e){return e.name===t.name})||e.push(t),e},[]);return function(){return i(function(){var e;return g(this,function(n){switch(n.label){case 0:switch(t){case C.CLI:return[3,1];case C.STRING:return[3,4]}return[3,5];case 1:e=s===null||s===void 0?void 0:s.length;if(!e)return[3,3];return[4,e7(s,{update:!0})];case 2:e=n.sent();n.label=3;case 3:return[2,(e,tf(tp("".concat(eB," ").concat(r))))];case 4:return[2,tf(tp(r))];case 5:throw new Error("Unsupported command type");case 6:return[2]}})})()}}h(e1,"buildCommand");var e2={simpleGitHooks:e1({type:C.CLI,packages:[{name:eK,type:Q.DEV_DEPENDENCY}],command:eH}),eslintInspect:e1({type:C.CLI,packages:[{name:eQ,type:Q.DEV_DEPENDENCY}],command:eW}),nodeModulesInspect:e1({type:C.CLI,packages:[{name:eJ,type:Q.DEV_DEPENDENCY}],command:ez}),eslintCheck:e1({type:C.CLI,packages:[{name:eR,type:Q.DEV_DEPENDENCY}],command:"".concat(eb," ").concat(eZ.WORKING_DIRECTORY," --no-cache")}),eslintFix:e1({type:C.CLI,packages:[{name:eR,type:Q.DEV_DEPENDENCY}],command:"".concat(eb," ").concat(eZ.WORKING_DIRECTORY," --fix --no-cache")}),typescriptCheck:e1({type:C.CLI,packages:[{name:eU,type:Q.DEPENDENCY}],command:"".concat(eF," -p ").concat(eZ.TS_CONFIG," --noEmit")}),testUnit:e1({type:C.CLI,packages:[{name:eG,type:Q.DEV_DEPENDENCY}],command:"".concat(eP," --config ").concat(eZ.UNIT_TEST_CONFIG)}),testE2e:e1({type:C.CLI,packages:[{name:eG,type:Q.DEV_DEPENDENCY}],command:"".concat(eP," --config ").concat(eZ.E2E_TEST_CONFIG)}),mongoMigrateCreate:h(function(e){return e1({type:C.CLI,packages:[{name:e$,type:Q.DEPENDENCY}],command:"".concat(eq," ").concat(eX," create ").concat(e," -f ").concat(eZ.MIGRATE_MONGO_CONFIG)})()},"mongoMigrateCreate"),mongoMigrateUp:e1({type:C.CLI,packages:[{name:e$,type:Q.DEPENDENCY}],command:"".concat(eq," ").concat(eX," up -f ").concat(eZ.MIGRATE_MONGO_CONFIG)}),mongoMigrateDown:e1({type:C.CLI,packages:[{name:e$,type:Q.DEPENDENCY}],command:"".concat(eq," ").concat(eX," down -f ").concat(eZ.MIGRATE_MONGO_CONFIG)}),commitLint:e1({type:C.CLI,packages:[{name:eM,type:Q.DEV_DEPENDENCY},{name:ew,type:Q.DEV_DEPENDENCY}],command:"".concat(eL," --edit ").concat(eZ.GIT_COMMIT_MSG," --config ").concat(eZ.COMMITLINT_CONFIG)}),lintStaged:e1({type:C.CLI,packages:[{name:ej,type:Q.DEV_DEPENDENCY}],command:"".concat(ek," --config ").concat(eZ.LINT_STAGED_CONFIG)}),configureGitHook:e1({type:C.STRING,command:"".concat(eY," config core.hooksPath ").concat(eZ.GIT_HOOK)}),stageBuildDirectory:e1({type:C.STRING,command:"".concat(eY," add ").concat(ey)}),build:e1({type:C.STRING,command:"".concat(eV," run --if-present build")}),pnpmInstallStandard:e1({type:C.STRING,command:"".concat(eV," install --no-frozen-lockfile")}),pnpmInstallLegacy:e1({type:C.STRING,command:"".concat(eV," install --no-frozen-lockfile --legacy-peer-deps")}),pnpmInstallForce:e1({type:C.STRING,command:"".concat(eV," install --no-frozen-lockfile --force")})};var e4=j();function e3(e){return i(function(){var t,n,r,i;return g(this,function(s){switch(s.label){case 0:s.trys.push([0,3,,4]);return[4,W("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=s.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=s.sent(),r=n.version;return[2,{success:!0,result:r}];case 3:i=s.sent();return[2,H(i)];case 4:return[2]}})})()}h(e3,"getLatestPackageVersion");function e5(e){return i(function(){var t,n,r,i,s,o,a,c,u,l,d,p,E,f,m,y,h,S,v;return g(this,function(g){switch(g.label){case 0:g.trys.push([0,2,,3]);if(!es(eZ.PACKAGE_JSON))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===Q.DEPENDENCY,isDevDependency:e.type===Q.DEV_DEPENDENCY,installedPath:"",file:{}}}];t=en(eZ.PACKAGE_JSON),n=t.name,r=t.version,i=r===void 0?"":r,s=t.dependencies,o=s===void 0?{}:s,a=t.devDependencies,c=a===void 0?{}:a;if(e.name===n)return[2,{success:!0,result:{name:n,currentVersion:i,latestVersion:i,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:e.type===Q.DEPENDENCY,isDevDependency:e.type===Q.DEV_DEPENDENCY,installedPath:eZ.PACKAGE_JSON,file:t}}];u=e.name in o,l=e.name in c;return[4,e3(e.name)];case 1:d=g.sent();if(!d.success)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:u,isDevDependency:l,installedPath:"",file:{}}}];if(!u&&!l)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:d.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===Q.DEPENDENCY,isDevDependency:e.type===Q.DEV_DEPENDENCY,installedPath:"",file:{}}}];f=(E=(p=o[e.name])!==null&&p!==void 0?p:c[e.name])!==null&&E!==void 0?E:"",m=ep(e4.CWD,eg,e.name,eh);if(!es(m))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:d.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:u,isDevDependency:l,installedPath:"",file:{}}}];y=en(m),h=y.version,S=h===void 0?"":h;return[2,f!==S?{success:!0,result:{name:e.name,currentVersion:S||f,latestVersion:d.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:!1,isDependency:u,isDevDependency:l,installedPath:m,file:y}}:{success:!0,result:{name:e.name,currentVersion:f,latestVersion:d.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:f===d.result,isDependency:u,isDevDependency:l,installedPath:m,file:y}}];case 2:v=g.sent();return[2,H(v)];case 3:return[2]}})})()}h(e5,"getPackage");function e8(e){return i(function(){var t,n,r,i,s;return g(this,function(o){try{;r=en(eZ.PACKAGE_JSON),i=(t=r.dependencies)!==null&&t!==void 0?t:{},s=(n=r.devDependencies)!==null&&n!==void 0?n:{};e.isDependency?i[e.name]=e.latestVersion:e.isDevDependency&&(s[e.name]=e.latestVersion),er(eZ.PACKAGE_JSON,JSON.stringify(r,null,4)),K.info('Updated "'.concat(e.name,'" to version ').concat(e.latestVersion))}catch(e){H(e)}return[2]})})()}h(e8,"updatePackage");function e6(){return i(function(){var e,t,n,r,i,s,o,a,c,u,l,d,p;return g(this,function(E){switch(E.label){case 0:E.trys.push([0,12,,13]);e=[{command:h(function(){return e2.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:h(function(){return e2.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:h(function(){return e2.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;E.label=1;case 1:E.trys.push([1,9,10,11]);i=e[Symbol.iterator]();E.label=2;case 2:if(!!(t=(s=i.next()).done))return[3,8];o=s.value,a=o.command,c=o.message;E.label=3;case 3:E.trys.push([3,6,,7]);return[4,a()];case 4:u=E.sent();return[4,tg("".concat(c," using: ").concat(u),u)];case 5:E.sent();return[2];case 6:l=E.sent();H(l);return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=E.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&i.return!=null){i.return()}}finally{if(n){throw r}}return[7];case 11:return[3,13];case 12:p=E.sent();H(p);return[3,13];case 13:return[2]}})})()}h(e6,"installDependencies");function e7(e,t){return i(function(){var n,r,i,s,o,a,c,u,l,d,p,E;return g(this,function(f){switch(f.label){case 0:if(!es(eZ.PACKAGE_JSON)){K.error("package.json not found. Aborting setup.");return[2]}f.label=1;case 1:f.trys.push([1,16,,17]);return[4,Promise.all(e.map(e5))];case 2:n=f.sent().filter(function(e){return e.success?!e.result.isCurrentProject&&(!e.result.isInstalled||!e.result.isUpToDate):!1});r=n.length>0;if(!r)return[3,7];return[4,Promise.all(n.map(function(e){return e.success?e8(e.result):Promise.resolve()}))];case 3:f.sent();return[4,e6()];case 4:f.sent();i=["Running ESLint with auto-fix"];return[4,e2.eslintFix()];case 5:return[4,tg.apply(void 0,i.concat([f.sent()]))];case 6:r=f.sent();f.label=7;case 7:r;o=true,a=false,c=undefined;f.label=8;case 8:f.trys.push([8,13,14,15]);u=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();f.label=9;case 9:if(!!(o=(l=u.next()).done))return[3,12];d=l.value;return[4,d()];case 10:f.sent();f.label=11;case 11:o=true;return[3,9];case 12:return[3,15];case 13:p=f.sent();a=true;c=p;return[3,15];case 14:try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw c}}return[7];case 15:return[3,17];case 16:E=f.sent();H(E);return[3,17];case 17:return[2]}})})()}h(e7,"setupPackages");import e9 from"node-persist";var te=j();function tt(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=e9.defaultInstance;if(e)return[3,2];return[4,e9.init({dir:te.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}h(tt,"initNodePersist");var tn={get:function e(e){return i(function(){var t,n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tt()];case 1:r.sent();return[4,e9.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,H(n,{returnValue:null})];case 4:return[2]}})})()},set:function e(e,t){return i(function(){var n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tt()];case 1:r.sent();return[4,e9.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();H(n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return i(function(){var t;return g(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tt()];case 1:n.sent();return[4,e9.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();H(t);return[3,4];case 4:return[2]}})})()},keys:function e(){return i(function(){var e,t;return g(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tt()];case 1:n.sent();return[4,e9.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(K.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,H(t,{returnValue:[]})];case 4:return[2]}})})()},getLogLink:function e(e){return i(function(){return g(this,function(t){try{return[2,"".concat(te.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,H(e,{returnValue:null})]}return[2]})})()}};var tr=j(),ti=T.promisify(I);function ts(e){return"error_list:".concat(e)}h(ts,"getErrorListKey");function to(e){return i(function(){var t,n,r;return g(this,function(s){switch(s.label){case 0:if(e.length===0)return[2];t=Date.now(),n=ts(t);s.label=1;case 1:s.trys.push([1,3,,4]);return[4,tn.set(n,{errors:e,timestamp:t})];case 2:s.sent(),setTimeout(function(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:return[4,tn.getLogLink(n)];case 1:e=t.sent();e&&K.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},10);return[3,4];case 3:r=s.sent();H(r);return[3,4];case 4:return[2]}})})()}h(to,"saveErrorListToStorage");function ta(){return i(function(){var e,t,n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tn.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return i(function(){var t;return g(this,function(n){switch(n.label){case 0:return[4,tn.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})})()}))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,H(n,{returnValue:[]})];case 4:return[2]}})})()}h(ta,"getStoredErrorLists");function tc(){return i(function(){var e,t,n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tn.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return tn.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();H(n);return[3,4];case 4:return[2]}})})()}h(tc,"clearAllErrorLists");function tu(e){var t=[],n=[],r="",i=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,s=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var a,c,u,l,d;var p=i.exec(e)||[],E=s.exec(e)||[],f=o.exec(e)||[];var m,g,y,h,S,v;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===k.Error?k.Error:k.Warning,message:(m=p===null||p===void 0?void 0:(a=p[4])===null||a===void 0?void 0:a.trim())!==null&&m!==void 0?m:"",rule:(g=p===null||p===void 0?void 0:(c=p[5])===null||c===void 0?void 0:c.trim())!==null&&g!==void 0?g:""}):E.length?t.push({file:(y=E===null||E===void 0?void 0:E[1])!==null&&y!==void 0?y:"",position:"".concat(E[2],":").concat(E[3]),type:E[4]===k.Error?k.Error:k.Warning,message:(h=E===null||E===void 0?void 0:(u=E[5])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:""}):f.length?t.push({file:"commitlint",type:k.Error,message:(S=f===null||f===void 0?void 0:(l=f[1])===null||l===void 0?void 0:l.trim())!==null&&S!==void 0?S:"",rule:(v=f===null||f===void 0?void 0:(d=f[2])===null||d===void 0?void 0:d.trim())!==null&&v!==void 0?v:""}):n.push(e.trim())}}),t.length&&to(t),tr.DEBUG&&n.length&&(K.warn("Unmatched lines:"),n.forEach(function(e){return K.info(" ".concat(e))}))}h(tu,"parseTextErrors");function tl(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,i=e.line,s=e.column,o=e.ruleId,a=e.message;n.push({type:r===2?k.Error:k.Warning,file:t,position:"".concat(i,":").concat(s),rule:o,message:a})})}),n.length&&to(n)}catch(t){tu(e)}}h(tl,"parseCommandOutput");function td(e){return i(function(e){var t,n,r,i,s,o,a,c,u;var l=arguments;return g(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tl;n=new AbortController;N.on("SIGINT",function(){K.warn("Process interrupted. Terminating..."),n.abort(),N.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,ti(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),i=r.stdout,s=r.stderr;[i,s].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:o=d.sent();a=o.stdout,c=o.stderr,u=o.message;[a,c].forEach(function(e){return e&&t(e)}),!c&&!a&&K.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}h(td,"executeCommand");function tp(e){return{raw:!0,cmd:e}}h(tp,"rawCommand");function tE(e,t){return(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eB," ").concat(eq," ").concat(e_," ").concat(e):"".concat(eB," ").concat(eA," ").concat(e)}h(tE,"formatCLI");function tf(e,t){return typeof e=="function"?tE(e(t),t):(typeof e==="undefined"?"undefined":f(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tE(e,t):e}h(tf,"formatCommand");function tm(e){return i(function(){var t,n,r;return g(this,function(i){switch(i.label){case 0:return[4,e5({name:em})];case 1:t=i.sent();if(t.success){n={isCurrentProject:t.result.isCurrentProject},r=typeof e=="function"?e(n):e;return[2,Object.fromEntries(Object.entries(r).map(function(e){var t=p(e,2),r=t[0],i=t[1];return[r,tf(i,n)]}))]}return[2]}})})()}h(tm,"resolveCommands");function tg(e,t){return i(function(){var n;return g(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);K.start("".concat(e)),tr.DEBUG&&K.info("→ ".concat(t));return[4,td(t)];case 1:r.sent(),K.success("".concat(e," done."));return[3,3];case 2:n=r.sent();H(n);return[3,3];case 3:return[2]}})})()}h(tg,"runCommand");function ty(){return i(function(){var e,t;return g(this,function(n){switch(n.label){case 0:if(!es(eZ.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,e2.typescriptCheck()];case 1:return[4,tg.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=K.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}h(ty,"checkTypescript");function th(){return i(function(){var e,t,n,r;var i=arguments;return g(this,function(s){switch(s.label){case 0:e=i.length>0&&i[0]!==void 0?i[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,e2.eslintFix()];case 1:return[4,tg.apply(void 0,n.concat([s.sent()]))];case 2:t=s.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,e2.eslintCheck()];case 4:return[4,tg.apply(void 0,r.concat([s.sent()]))];case 5:t=s.sent();s.label=6;case 6:t;return[2]}})}).apply(this,arguments)}h(th,"checkEslint");function tS(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";K.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}h(tS,"printIssues");function tv(){return i(function(){var e,t,n;return g(this,function(r){switch(r.label){case 0:return[4,ta()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===k.Error}),n=e.filter(function(e){return e.type===k.Warning});!t.length&&!n.length?K.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tS("Warnings",n),tS("Errors",t),(t.length>0||n.length>0)&&S.exit(1));return[2]}})})()}h(tv,"showCheckResult");function tD(){return i(function(){var e,t,n,r,i;return g(this,function(s){switch(s.label){case 0:return[4,tc()];case 1:s.sent();return[4,e5({name:em})];case 2:e=s.sent();if(!e.success){K.error("Failed to retrieve package information. Aborting lint-staged.");return[2]}t=e.result.isCurrentProject;if(!t)return[3,7];n=["Building package: ".concat(em)];return[4,e2.build()];case 3:return[4,tg.apply(void 0,n.concat([s.sent()]))];case 4:s.sent();r=["Staging build artifacts"];return[4,e2.stageBuildDirectory()];case 5:return[4,tg.apply(void 0,r.concat([s.sent()]))];case 6:t=s.sent();s.label=7;case 7:t;i=["Executing lint-staged"];return[4,e2.lintStaged()];case 8:return[4,tg.apply(void 0,i.concat([s.sent()]))];case 9:s.sent(),tv();return[2]}})})()}h(tD,"lintStaged");function tO(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,e2.eslintInspect()];case 1:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(tO,"inspectLint");function tC(){return i(function(){return g(this,function(e){switch(e.label){case 0:return[4,tc()];case 1:e.sent();return[4,Promise.all([ty(),th()])];case 2:e.sent(),tv();return[2]}})})()}h(tC,"lintCheck");function tI(){return i(function(){return g(this,function(e){switch(e.label){case 0:return[4,tc()];case 1:e.sent();return[4,Promise.all([ty(),th(!0)])];case 2:e.sent(),tv();return[2]}})})()}h(tI,"lintFix");function tN(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:return[4,tc()];case 1:t.sent();e=["Validating commit message"];return[4,e2.commitLint()];case 2:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tv();return[2]}})})()}h(tN,"commitLint");function tT(){return i(function(){var e,t,n,r;return g(this,function(i){switch(i.label){case 0:e=["Configuring Git hooks"];return[4,e2.configureGitHook()];case 1:return[4,tg.apply(void 0,e.concat([i.sent()]))];case 2:i.sent(),eo(eZ.GIT_HOOK);return[4,tm(e0)];case 3:t=i.sent();er(eZ.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));n="\n".concat(eO,"\n");es(eZ.GIT_IGNORE)?Z(eZ.GIT_IGNORE,"utf-8").split("\n").includes(eO)||ei(eZ.GIT_IGNORE,n):er(eZ.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,e2.simpleGitHooks()];case 4:return[4,tg.apply(void 0,r.concat([i.sent()]))];case 5:i.sent();return[2]}})})()}h(tT,"setupGitHook");function tx(){return i(function(){return g(this,function(e){switch(e.label){case 0:return[4,e7([{name:em,type:Q.DEPENDENCY}],{update:!0,postInstallActions:[tT]})];case 1:e.sent();return[2]}})})()}h(tx,"prepare");function tA(){return i(function(){return g(this,function(e){switch(e.label){case 0:eo(eZ.NODE_MODULES,eZ.PNPM_LOCK_YAML);return[4,e6()];case 1:e.sent();return[4,tT()];case 2:e.sent();return[2]}})})()}h(tA,"reset");function t_(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,e2.nodeModulesInspect()];case 1:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(t_,"inspect");function tR(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,e2.testUnit()];case 1:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(tR,"testUnit");function tb(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,e2.testE2e()];case 1:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(tb,"testE2E");function tG(e){return i(function(){var t;return g(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,e2.mongoMigrateCreate(e)];case 1:return[4,tg.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}h(tG,"mongoMigrateCreate");function tP(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,e2.mongoMigrateUp()];case 1:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(tP,"mongoMigrateUp");function tM(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,e2.mongoMigrateDown()];case 1:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(tM,"mongoMigrateDown");(function(){return i(function(){var e;return g(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,D(v(S.argv)).scriptName(eA).usage("$0 <command> [options]").command("lint","Check code for linting issues",tC).command("lint:fix","Fix linting issues automatically",tI).command("lint:inspect","View active ESLint configuration",tO).command("lint-staged","Run lint checks on staged files",tD).command("commitlint","Validate commit message format",tN).command("prepare","Initialize project and dependencies",tx).command("reset","Reset the project and reinstall dependencies",tA).command("inspect","Analyze installed project dependencies",t_).command("test:unit","Run unit test suite",tR).command("test:e2e","Run end-to-end test suite",tb).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},function(e){return i(function(){return g(this,function(t){switch(t.label){case 0:if(!e.name){K.error("Migration name is required.");return[2]}return[4,tG(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",tP).command("mongo:migrate:down","Rollback last MongoDB migration",tM).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(O.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();H(e),S.exit(1);return[3,3];case 3:return[2]}})})()})();
@@ -1,8 +1,8 @@
1
- export { I_EslintError_alias_2 as I_EslintError } from '../../_tsup-dts-rollup.cjs';
2
- export { I_CommandContext_alias_2 as I_CommandContext } from '../../_tsup-dts-rollup.cjs';
3
- export { I_Command_alias_2 as I_Command } from '../../_tsup-dts-rollup.cjs';
4
- export { T_CommandFunction_alias_2 as T_CommandFunction } from '../../_tsup-dts-rollup.cjs';
5
- export { T_Command_alias_2 as T_Command } from '../../_tsup-dts-rollup.cjs';
6
- export { T_CommandMap_alias_2 as T_CommandMap } from '../../_tsup-dts-rollup.cjs';
7
- export { T_CommandMapInput_alias_2 as T_CommandMapInput } from '../../_tsup-dts-rollup.cjs';
8
- export { E_CommandType_alias_2 as E_CommandType } from '../../_tsup-dts-rollup.cjs';
1
+ export { I_EslintError_alias_1 as I_EslintError } from '../../_tsup-dts-rollup.cjs';
2
+ export { I_CommandContext_alias_1 as I_CommandContext } from '../../_tsup-dts-rollup.cjs';
3
+ export { I_Command_alias_1 as I_Command } from '../../_tsup-dts-rollup.cjs';
4
+ export { T_CommandFunction_alias_1 as T_CommandFunction } from '../../_tsup-dts-rollup.cjs';
5
+ export { T_Command_alias_1 as T_Command } from '../../_tsup-dts-rollup.cjs';
6
+ export { T_CommandMap_alias_1 as T_CommandMap } from '../../_tsup-dts-rollup.cjs';
7
+ export { T_CommandMapInput_alias_1 as T_CommandMapInput } from '../../_tsup-dts-rollup.cjs';
8
+ export { E_CommandType_alias_1 as E_CommandType } from '../../_tsup-dts-rollup.cjs';
@@ -1,8 +1,8 @@
1
- export { I_EslintError_alias_2 as I_EslintError } from '../../_tsup-dts-rollup.js';
2
- export { I_CommandContext_alias_2 as I_CommandContext } from '../../_tsup-dts-rollup.js';
3
- export { I_Command_alias_2 as I_Command } from '../../_tsup-dts-rollup.js';
4
- export { T_CommandFunction_alias_2 as T_CommandFunction } from '../../_tsup-dts-rollup.js';
5
- export { T_Command_alias_2 as T_Command } from '../../_tsup-dts-rollup.js';
6
- export { T_CommandMap_alias_2 as T_CommandMap } from '../../_tsup-dts-rollup.js';
7
- export { T_CommandMapInput_alias_2 as T_CommandMapInput } from '../../_tsup-dts-rollup.js';
8
- export { E_CommandType_alias_2 as E_CommandType } from '../../_tsup-dts-rollup.js';
1
+ export { I_EslintError_alias_1 as I_EslintError } from '../../_tsup-dts-rollup.js';
2
+ export { I_CommandContext_alias_1 as I_CommandContext } from '../../_tsup-dts-rollup.js';
3
+ export { I_Command_alias_1 as I_Command } from '../../_tsup-dts-rollup.js';
4
+ export { T_CommandFunction_alias_1 as T_CommandFunction } from '../../_tsup-dts-rollup.js';
5
+ export { T_Command_alias_1 as T_Command } from '../../_tsup-dts-rollup.js';
6
+ export { T_CommandMap_alias_1 as T_CommandMap } from '../../_tsup-dts-rollup.js';
7
+ export { T_CommandMapInput_alias_1 as T_CommandMapInput } from '../../_tsup-dts-rollup.js';
8
+ export { E_CommandType_alias_1 as E_CommandType } from '../../_tsup-dts-rollup.js';