@cyberskill/shared 1.208.0 → 1.209.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 (202) hide show
  1. package/dist/config-CwzVfkkX.js +6 -0
  2. package/dist/index-BG1UznTl.js +628 -0
  3. package/dist/{magic-string.es-C6Zk6wMx.js → magic-string.es-BQ9KnLz-.js} +105 -117
  4. package/dist/src/config/config.type.d.ts +1 -1
  5. package/dist/src/config/config.util.d.ts +1 -1
  6. package/dist/src/config/config.util.js +48 -7
  7. package/dist/src/config/env/env.util.js +10 -10
  8. package/dist/src/config/eslint/index.js +4 -15
  9. package/dist/src/config/graphql-codegen/graphql-codegen.util.js +30 -39
  10. package/dist/src/config/index.js +1 -1
  11. package/dist/src/config/vitest/vitest.e2e.js +9 -19
  12. package/dist/src/config/vitest/vitest.unit.js +11 -22
  13. package/dist/src/config/vitest/vitest.unit.setup.js +9339 -9868
  14. package/dist/src/constant/common.js +1 -1
  15. package/dist/src/node/apollo-server/apollo-server.util.js +23 -54
  16. package/dist/src/node/cli/index.d.ts +2 -1
  17. package/dist/src/node/cli/index.js +108 -1
  18. package/dist/src/node/command/command.util.js +9 -10
  19. package/dist/src/node/command/index.js +1 -1
  20. package/dist/src/node/express/express.util.js +39 -77
  21. package/dist/src/node/express/index.js +9 -9
  22. package/dist/src/node/fs/fs.util.js +40 -59
  23. package/dist/src/node/log/index.js +6 -6
  24. package/dist/src/node/log/log.util.js +32 -33
  25. package/dist/src/node/mongo/mongo.util.js +381 -457
  26. package/dist/src/node/package/index.js +3 -3
  27. package/dist/src/node/package/package.util.js +2 -2
  28. package/dist/src/node/path/index.js +30 -30
  29. package/dist/src/node/path/path.constant.js +30 -30
  30. package/dist/src/node/storage/storage.util.js +40 -70
  31. package/dist/src/node/upload/index.js +1 -1
  32. package/dist/src/node/upload/upload.util.js +125 -6
  33. package/dist/src/react/apollo-client/apollo-client.component.js +15 -13
  34. package/dist/src/react/apollo-client/apollo-client.type.d.ts +1 -1
  35. package/dist/src/react/apollo-client/apollo-client.util.js +66 -81
  36. package/dist/src/react/apollo-client/index.js +25 -26
  37. package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.component.js +7 -8
  38. package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.util.js +11 -21
  39. package/dist/src/react/apollo-error/apollo-error.component.js +7 -7
  40. package/dist/src/react/apollo-error/apollo-error.util.js +7 -7
  41. package/dist/src/react/loading/loading.component.js +24 -45
  42. package/dist/src/react/loading/loading.provider.d.ts +1 -1
  43. package/dist/src/react/log/log.util.js +9 -9
  44. package/dist/src/react/next-intl/next-intl.hoc.d.ts +1 -1
  45. package/dist/src/react/next-intl/next-intl.hoc.js +17 -29
  46. package/dist/src/react/next-intl/next-intl.provider.js +18 -19
  47. package/dist/src/react/next-intl/next-intl.type.d.ts +1 -1
  48. package/dist/src/react/storage/storage.hook.js +37 -53
  49. package/dist/src/react/storage/storage.util.js +25 -50
  50. package/dist/src/react/userback/userback.component.js +16 -43
  51. package/dist/src/typescript/index.d.ts +2 -2
  52. package/dist/src/typescript/index.js +2 -2
  53. package/dist/src/typescript/style.d.js +1 -1
  54. package/dist/src/util/common/common.util.js +14 -25
  55. package/dist/src/util/object/object.util.d.ts +1 -1
  56. package/dist/src/util/object/object.util.js +39 -49
  57. package/dist/src/util/string/string.util.js +40 -53
  58. package/dist/style.css +1 -1
  59. package/package.json +43 -76
  60. package/dist/config-B7WSlzSh.js +0 -8
  61. package/dist/config-DDQ9k8fw.cjs +0 -1
  62. package/dist/config.util-Ci2CZDut.cjs +0 -1
  63. package/dist/config.util-DKBwEBKR.js +0 -61
  64. package/dist/favicon/android-icon-144x144.png +0 -0
  65. package/dist/favicon/android-icon-192x192.png +0 -0
  66. package/dist/favicon/android-icon-36x36.png +0 -0
  67. package/dist/favicon/android-icon-48x48.png +0 -0
  68. package/dist/favicon/android-icon-72x72.png +0 -0
  69. package/dist/favicon/android-icon-96x96.png +0 -0
  70. package/dist/favicon/apple-icon-114x114.png +0 -0
  71. package/dist/favicon/apple-icon-120x120.png +0 -0
  72. package/dist/favicon/apple-icon-144x144.png +0 -0
  73. package/dist/favicon/apple-icon-152x152.png +0 -0
  74. package/dist/favicon/apple-icon-180x180.png +0 -0
  75. package/dist/favicon/apple-icon-57x57.png +0 -0
  76. package/dist/favicon/apple-icon-60x60.png +0 -0
  77. package/dist/favicon/apple-icon-72x72.png +0 -0
  78. package/dist/favicon/apple-icon-76x76.png +0 -0
  79. package/dist/favicon/apple-icon-precomposed.png +0 -0
  80. package/dist/favicon/apple-icon.png +0 -0
  81. package/dist/favicon/browserconfig.xml +0 -2
  82. package/dist/favicon/favicon-16x16.png +0 -0
  83. package/dist/favicon/favicon-32x32.png +0 -0
  84. package/dist/favicon/favicon-96x96.png +0 -0
  85. package/dist/favicon/favicon.ico +0 -0
  86. package/dist/favicon/manifest.json +0 -41
  87. package/dist/favicon/ms-icon-144x144.png +0 -0
  88. package/dist/favicon/ms-icon-150x150.png +0 -0
  89. package/dist/favicon/ms-icon-310x310.png +0 -0
  90. package/dist/favicon/ms-icon-70x70.png +0 -0
  91. package/dist/log.type-CMvG6Box.cjs +0 -1
  92. package/dist/log.type-DTOvZHyz.js +0 -4
  93. package/dist/magic-string.es-CjWtD8Pa.cjs +0 -10
  94. package/dist/path.constant-CWtb99gS.cjs +0 -2
  95. package/dist/path.constant-CvSr0Rrx.js +0 -682
  96. package/dist/src/config/commitlint/index.cjs +0 -1
  97. package/dist/src/config/config.util.cjs +0 -1
  98. package/dist/src/config/env/env.constant.cjs +0 -1
  99. package/dist/src/config/env/env.d.cjs +0 -1
  100. package/dist/src/config/env/env.d.js +0 -1
  101. package/dist/src/config/env/env.util.cjs +0 -1
  102. package/dist/src/config/env/index.cjs +0 -1
  103. package/dist/src/config/eslint/index.cjs +0 -1
  104. package/dist/src/config/graphql-codegen/graphql-codegen.util.cjs +0 -1
  105. package/dist/src/config/graphql-codegen/index.cjs +0 -1
  106. package/dist/src/config/index.cjs +0 -1
  107. package/dist/src/config/lint-staged/index.cjs +0 -1
  108. package/dist/src/config/vitest/index.cjs +0 -1
  109. package/dist/src/config/vitest/vitest.e2e.cjs +0 -1
  110. package/dist/src/config/vitest/vitest.unit.cjs +0 -1
  111. package/dist/src/config/vitest/vitest.unit.setup.cjs +0 -508
  112. package/dist/src/constant/common.cjs +0 -1
  113. package/dist/src/constant/index.cjs +0 -1
  114. package/dist/src/constant/response-status.cjs +0 -1
  115. package/dist/src/node/apollo-server/apollo-server.util.cjs +0 -1
  116. package/dist/src/node/apollo-server/index.cjs +0 -1
  117. package/dist/src/node/cli/cli.util.cjs +0 -6
  118. package/dist/src/node/cli/cli.util.d.ts +0 -2
  119. package/dist/src/node/cli/cli.util.js +0 -171
  120. package/dist/src/node/cli/index.cjs +0 -1
  121. package/dist/src/node/command/command.util.cjs +0 -1
  122. package/dist/src/node/command/index.cjs +0 -1
  123. package/dist/src/node/express/express.util.cjs +0 -1
  124. package/dist/src/node/express/index.cjs +0 -1
  125. package/dist/src/node/fs/fs.util.cjs +0 -1
  126. package/dist/src/node/fs/index.cjs +0 -1
  127. package/dist/src/node/log/index.cjs +0 -1
  128. package/dist/src/node/log/log.util.cjs +0 -1
  129. package/dist/src/node/mongo/index.cjs +0 -1
  130. package/dist/src/node/mongo/mongo.constant.cjs +0 -1
  131. package/dist/src/node/mongo/mongo.util.cjs +0 -5
  132. package/dist/src/node/package/index.cjs +0 -1
  133. package/dist/src/node/package/package.util.cjs +0 -1
  134. package/dist/src/node/path/index.cjs +0 -1
  135. package/dist/src/node/path/path.constant.cjs +0 -1
  136. package/dist/src/node/path/path.util.cjs +0 -1
  137. package/dist/src/node/storage/index.cjs +0 -1
  138. package/dist/src/node/storage/storage.util.cjs +0 -1
  139. package/dist/src/node/upload/index.cjs +0 -1
  140. package/dist/src/node/upload/upload.util.cjs +0 -1
  141. package/dist/src/node/ws/index.cjs +0 -1
  142. package/dist/src/node/ws/ts.util.cjs +0 -1
  143. package/dist/src/react/apollo-client/apollo-client.component.cjs +0 -1
  144. package/dist/src/react/apollo-client/apollo-client.constant.cjs +0 -1
  145. package/dist/src/react/apollo-client/apollo-client.context.cjs +0 -1
  146. package/dist/src/react/apollo-client/apollo-client.hook.cjs +0 -1
  147. package/dist/src/react/apollo-client/apollo-client.util.cjs +0 -1
  148. package/dist/src/react/apollo-client/index.cjs +0 -1
  149. package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.component.cjs +0 -1
  150. package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.rsc.cjs +0 -1
  151. package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.util.cjs +0 -1
  152. package/dist/src/react/apollo-client-nextjs/index.cjs +0 -1
  153. package/dist/src/react/apollo-error/apollo-error.component.cjs +0 -1
  154. package/dist/src/react/apollo-error/apollo-error.context.cjs +0 -1
  155. package/dist/src/react/apollo-error/apollo-error.hook.cjs +0 -1
  156. package/dist/src/react/apollo-error/apollo-error.provider.cjs +0 -1
  157. package/dist/src/react/apollo-error/apollo-error.util.cjs +0 -1
  158. package/dist/src/react/apollo-error/index.cjs +0 -1
  159. package/dist/src/react/i18next/i18next.hook.cjs +0 -1
  160. package/dist/src/react/i18next/i18next.util.cjs +0 -1
  161. package/dist/src/react/i18next/index.cjs +0 -1
  162. package/dist/src/react/loading/index.cjs +0 -1
  163. package/dist/src/react/loading/loading.component.cjs +0 -6
  164. package/dist/src/react/loading/loading.context.cjs +0 -1
  165. package/dist/src/react/loading/loading.hook.cjs +0 -1
  166. package/dist/src/react/loading/loading.provider.cjs +0 -1
  167. package/dist/src/react/log/index.cjs +0 -1
  168. package/dist/src/react/log/log.util.cjs +0 -1
  169. package/dist/src/react/next-intl/index.cjs +0 -1
  170. package/dist/src/react/next-intl/next-intl.constant.cjs +0 -1
  171. package/dist/src/react/next-intl/next-intl.context.cjs +0 -1
  172. package/dist/src/react/next-intl/next-intl.hoc.cjs +0 -1
  173. package/dist/src/react/next-intl/next-intl.hook.cjs +0 -1
  174. package/dist/src/react/next-intl/next-intl.provider.cjs +0 -1
  175. package/dist/src/react/storage/index.cjs +0 -1
  176. package/dist/src/react/storage/storage.hook.cjs +0 -1
  177. package/dist/src/react/storage/storage.util.cjs +0 -1
  178. package/dist/src/react/toast/index.cjs +0 -1
  179. package/dist/src/react/userback/index.cjs +0 -1
  180. package/dist/src/react/userback/userback.component.cjs +0 -1
  181. package/dist/src/typescript/common.cjs +0 -1
  182. package/dist/src/typescript/common.js +0 -4
  183. package/dist/src/typescript/index.cjs +0 -1
  184. package/dist/src/typescript/react.cjs +0 -1
  185. package/dist/src/typescript/react.js +0 -1
  186. package/dist/src/typescript/style.d.cjs +0 -1
  187. package/dist/src/util/common/common.util.cjs +0 -1
  188. package/dist/src/util/common/index.cjs +0 -1
  189. package/dist/src/util/index.cjs +0 -1
  190. package/dist/src/util/object/index.cjs +0 -1
  191. package/dist/src/util/object/object.util.cjs +0 -1
  192. package/dist/src/util/serializer/index.cjs +0 -1
  193. package/dist/src/util/serializer/serializer.util.cjs +0 -1
  194. package/dist/src/util/string/index.cjs +0 -1
  195. package/dist/src/util/string/string.util.cjs +0 -1
  196. package/dist/src/util/validate/index.cjs +0 -1
  197. package/dist/src/util/validate/validate.util.cjs +0 -1
  198. package/dist/tsconfig.base.json +0 -37
  199. package/dist/upload.util-CE3MjBdh.cjs +0 -1
  200. package/dist/upload.util-D4aUdmPo.js +0 -160
  201. /package/dist/src/typescript/{common.d.ts → common.type.d.ts} +0 -0
  202. /package/dist/src/typescript/{react.d.ts → react.type.d.ts} +0 -0
@@ -1,8 +1,8 @@
1
- import { J as s, K as t, O as g, R as c, U as k, Q as p } from "../../../path.constant-CvSr0Rrx.js";
1
+ import { E as s, h as g, g as t, i as c, s as k, u as p } from "../../../index-BG1UznTl.js";
2
2
  export {
3
3
  s as E_PackageType,
4
- t as getLatestPackageVersion,
5
- g as getPackage,
4
+ g as getLatestPackageVersion,
5
+ t as getPackage,
6
6
  c as installDependencies,
7
7
  k as setupPackages,
8
8
  p as updatePackage
@@ -1,9 +1,9 @@
1
1
  import "node-fetch";
2
- import "../../config/env/env.util.js";
3
- import { K as r, O as g, R as m, U as c, Q as k } from "../../../path.constant-CvSr0Rrx.js";
2
+ import { h as r, g, i as m, s as c, u as k } from "../../../index-BG1UznTl.js";
4
3
  import "../fs/fs.util.js";
5
4
  import "../log/log.util.js";
6
5
  import "../path/path.util.js";
6
+ import "../../config/env/env.util.js";
7
7
  export {
8
8
  r as getLatestPackageVersion,
9
9
  g as getPackage,
@@ -1,11 +1,11 @@
1
- import { B as E, m as C, l as a, k as s, g as A, h as N, f as T, C as L, i as O, x as M, w as G, E as S, r as P, e as K, d as R, G as D, n as o, L as e, D as r, M as Y, A as H, N as t, z as B, y as i, a as m, b as n, F as U, s as f, t as p, c as F, P as J, u as V, v as c, S as d, T as g, p as h, o as k, q as l, j as v, V as x, W, I as j, H as X } from "../../../path.constant-CvSr0Rrx.js";
2
- import { dirname as q, join as u, path as w, resolve as y, resolveWorkingPath as z } from "./path.util.js";
1
+ import { B as E, F as C, D as a, A, C as s, w as N, v as T, b as L, y as O, Z as M, Y as G, x as S, O as P, t as K, q as R, G as D, H as o, L as Y, a1 as e, M as r, a0 as H, N as t, $ as B, _ as m, n, o as U, P as i, Q as J, R as f, p, m as F, U as V, X as v, S as x, T as W, J as X, I as c, K as d, z as g, V as h, W as k, a as l, f as b } from "../../../index-BG1UznTl.js";
2
+ import { dirname as q, join as w, path as y, resolve as z, resolveWorkingPath as Q } from "./path.util.js";
3
3
  export {
4
4
  E as BUILD_DIRECTORY,
5
5
  C as COMMIT_LINT_CLI,
6
6
  a as COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME,
7
- s as COMMIT_LINT_PACKAGE_NAME,
8
- A as CYBERSKILL_CLI,
7
+ A as COMMIT_LINT_PACKAGE_NAME,
8
+ s as CYBERSKILL_CLI,
9
9
  N as CYBERSKILL_CLI_PATH,
10
10
  T as CYBERSKILL_DIRECTORY,
11
11
  L as CYBERSKILL_PACKAGE_NAME,
@@ -18,35 +18,35 @@ export {
18
18
  R as GIT_HOOK,
19
19
  D as GIT_IGNORE,
20
20
  o as LINT_STAGED_CLI,
21
- e as LINT_STAGED_PACKAGE_NAME,
22
- r as MIGRATE_MONGO_CLI,
23
- Y as MIGRATE_MONGO_CONFIG,
21
+ Y as LINT_STAGED_PACKAGE_NAME,
22
+ e as MIGRATE_MONGO_CLI,
23
+ r as MIGRATE_MONGO_CONFIG,
24
24
  H as MIGRATE_MONGO_PACKAGE_NAME,
25
25
  t as NODE_MODULES,
26
26
  B as NODE_MODULES_INSPECT_CLI,
27
- i as NODE_MODULES_INSPECT_PACKAGE_NAME,
28
- m as PACKAGE_JSON,
29
- n as PACKAGE_LOCK_JSON,
30
- U as PATH,
31
- f as PNPM_CLI,
32
- p as PNPM_EXEC_CLI,
33
- F as PNPM_LOCK_YAML,
34
- J as PUBLIC_DIRECTORY,
27
+ m as NODE_MODULES_INSPECT_PACKAGE_NAME,
28
+ n as PACKAGE_JSON,
29
+ U as PACKAGE_LOCK_JSON,
30
+ i as PATH,
31
+ J as PNPM_CLI,
32
+ f as PNPM_EXEC_CLI,
33
+ p as PNPM_LOCK_YAML,
34
+ F as PUBLIC_DIRECTORY,
35
35
  V as SIMPLE_GIT_HOOKS_PACKAGE_NAME,
36
- c as SIMPLE_GIT_HOOK_CLI,
37
- d as SIMPLE_GIT_HOOK_JSON,
38
- g as TSCONFIG_JSON,
39
- h as TSC_CLI,
40
- k as TSC_PACKAGE_NAME,
41
- l as TSX_CLI,
42
- v as VITEST_CLI,
43
- x as VITEST_PACKAGE_NAME,
44
- W as WORKING_DIRECTORY,
45
- j as command,
46
- X as createGitHooksConfig,
36
+ v as SIMPLE_GIT_HOOK_CLI,
37
+ x as SIMPLE_GIT_HOOK_JSON,
38
+ W as TSCONFIG_JSON,
39
+ X as TSC_CLI,
40
+ c as TSC_PACKAGE_NAME,
41
+ d as TSX_CLI,
42
+ g as VITEST_CLI,
43
+ h as VITEST_PACKAGE_NAME,
44
+ k as WORKING_DIRECTORY,
45
+ l as command,
46
+ b as createGitHooksConfig,
47
47
  q as dirname,
48
- u as join,
49
- w as path,
50
- y as resolve,
51
- z as resolveWorkingPath
48
+ w as join,
49
+ y as path,
50
+ z as resolve,
51
+ Q as resolveWorkingPath
52
52
  };
@@ -1,13 +1,13 @@
1
1
  import "fs-extra";
2
- import "../../config/env/env.util.js";
3
- import { B as a, m as N, l as T, k as s, g as L, h as O, f as M, C as G, i as S, x as P, w as K, E as R, r as D, e as o, d as Y, G as H, n as m, L as r, D as t, M as B, A as i, N as p, z as U, y as e, a as F, b as J, F as V, s as c, t as f, c as n, P as d, u as g, v as k, S as x, T as W, p as X, o as b, q as h, j, V as l, W as q, I as u, H as v } from "../../../path.constant-CvSr0Rrx.js";
4
2
  import "./path.util.js";
3
+ import { B as A, F as N, D as T, A as L, C as s, w as O, v as M, b as G, y as S, Z as P, Y as K, x as R, O as D, t as o, q as Y, G as H, H as m, L as t, a1 as B, M as r, a0 as U, N as i, $ as p, _ as J, n as F, o as V, P as e, Q as f, R as n, p as X, m as c, U as x, X as W, S as b, T as d, J as g, I as k, K as q, z as v, V as w, W as y, a as z, f as Q } from "../../../index-BG1UznTl.js";
4
+ import "../../config/env/env.util.js";
5
5
  export {
6
- a as BUILD_DIRECTORY,
6
+ A as BUILD_DIRECTORY,
7
7
  N as COMMIT_LINT_CLI,
8
8
  T as COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME,
9
- s as COMMIT_LINT_PACKAGE_NAME,
10
- L as CYBERSKILL_CLI,
9
+ L as COMMIT_LINT_PACKAGE_NAME,
10
+ s as CYBERSKILL_CLI,
11
11
  O as CYBERSKILL_CLI_PATH,
12
12
  M as CYBERSKILL_DIRECTORY,
13
13
  G as CYBERSKILL_PACKAGE_NAME,
@@ -20,30 +20,30 @@ export {
20
20
  Y as GIT_HOOK,
21
21
  H as GIT_IGNORE,
22
22
  m as LINT_STAGED_CLI,
23
- r as LINT_STAGED_PACKAGE_NAME,
24
- t as MIGRATE_MONGO_CLI,
25
- B as MIGRATE_MONGO_CONFIG,
26
- i as MIGRATE_MONGO_PACKAGE_NAME,
27
- p as NODE_MODULES,
28
- U as NODE_MODULES_INSPECT_CLI,
29
- e as NODE_MODULES_INSPECT_PACKAGE_NAME,
23
+ t as LINT_STAGED_PACKAGE_NAME,
24
+ B as MIGRATE_MONGO_CLI,
25
+ r as MIGRATE_MONGO_CONFIG,
26
+ U as MIGRATE_MONGO_PACKAGE_NAME,
27
+ i as NODE_MODULES,
28
+ p as NODE_MODULES_INSPECT_CLI,
29
+ J as NODE_MODULES_INSPECT_PACKAGE_NAME,
30
30
  F as PACKAGE_JSON,
31
- J as PACKAGE_LOCK_JSON,
32
- V as PATH,
33
- c as PNPM_CLI,
34
- f as PNPM_EXEC_CLI,
35
- n as PNPM_LOCK_YAML,
36
- d as PUBLIC_DIRECTORY,
37
- g as SIMPLE_GIT_HOOKS_PACKAGE_NAME,
38
- k as SIMPLE_GIT_HOOK_CLI,
39
- x as SIMPLE_GIT_HOOK_JSON,
40
- W as TSCONFIG_JSON,
41
- X as TSC_CLI,
42
- b as TSC_PACKAGE_NAME,
43
- h as TSX_CLI,
44
- j as VITEST_CLI,
45
- l as VITEST_PACKAGE_NAME,
46
- q as WORKING_DIRECTORY,
47
- u as command,
48
- v as createGitHooksConfig
31
+ V as PACKAGE_LOCK_JSON,
32
+ e as PATH,
33
+ f as PNPM_CLI,
34
+ n as PNPM_EXEC_CLI,
35
+ X as PNPM_LOCK_YAML,
36
+ c as PUBLIC_DIRECTORY,
37
+ x as SIMPLE_GIT_HOOKS_PACKAGE_NAME,
38
+ W as SIMPLE_GIT_HOOK_CLI,
39
+ b as SIMPLE_GIT_HOOK_JSON,
40
+ d as TSCONFIG_JSON,
41
+ g as TSC_CLI,
42
+ k as TSC_PACKAGE_NAME,
43
+ q as TSX_CLI,
44
+ v as VITEST_CLI,
45
+ w as VITEST_PACKAGE_NAME,
46
+ y as WORKING_DIRECTORY,
47
+ z as command,
48
+ Q as createGitHooksConfig
49
49
  };
@@ -1,81 +1,51 @@
1
- var a = (r, t, n) => new Promise((m, u) => {
2
- var g = (e) => {
1
+ import e from "node-persist";
2
+ import { getEnv as c } from "../../config/env/env.util.js";
3
+ import { catchError as a, log as i } from "../log/log.util.js";
4
+ const s = c();
5
+ async function n() {
6
+ e.defaultInstance || await e.init({
7
+ dir: s.CYBERSKILL_STORAGE_DIRECTORY
8
+ });
9
+ }
10
+ const m = {
11
+ async get(r) {
3
12
  try {
4
- i(n.next(e));
5
- } catch (y) {
6
- u(y);
13
+ return await n(), await e.getItem(r) ?? null;
14
+ } catch (t) {
15
+ return a(t, { returnValue: null });
7
16
  }
8
- }, w = (e) => {
17
+ },
18
+ async set(r, t) {
9
19
  try {
10
- i(n.throw(e));
11
- } catch (y) {
12
- u(y);
20
+ await n(), await e.setItem(r, t);
21
+ } catch (o) {
22
+ a(o);
13
23
  }
14
- }, i = (e) => e.done ? m(e.value) : Promise.resolve(e.value).then(g, w);
15
- i((n = n.apply(r, t)).next());
16
- });
17
- import o from "node-persist";
18
- import { getEnv as I } from "../../config/env/env.util.js";
19
- import { catchError as s, log as h } from "../log/log.util.js";
20
- const l = I();
21
- function c() {
22
- return a(this, null, function* () {
23
- o.defaultInstance || (yield o.init({
24
- dir: l.CYBERSKILL_STORAGE_DIRECTORY
25
- }));
26
- });
27
- }
28
- const L = {
29
- get(r) {
30
- return a(this, null, function* () {
31
- try {
32
- yield c();
33
- const t = yield o.getItem(r);
34
- return t != null ? t : null;
35
- } catch (t) {
36
- return s(t, { returnValue: null });
37
- }
38
- });
39
- },
40
- set(r, t) {
41
- return a(this, null, function* () {
42
- try {
43
- yield c(), yield o.setItem(r, t);
44
- } catch (n) {
45
- s(n);
46
- }
47
- });
48
24
  },
49
- remove(r) {
50
- return a(this, null, function* () {
51
- try {
52
- yield c(), yield o.removeItem(r);
53
- } catch (t) {
54
- s(t);
55
- }
56
- });
25
+ async remove(r) {
26
+ try {
27
+ await n(), await e.removeItem(r);
28
+ } catch (t) {
29
+ a(t);
30
+ }
57
31
  },
58
- keys() {
59
- return a(this, null, function* () {
60
- try {
61
- yield c();
62
- const r = yield o.keys();
63
- return Array.isArray(r) ? r : (h.warn("[Storage:keys] Invalid keys response:", r), []);
64
- } catch (r) {
65
- return s(r, { returnValue: [] });
66
- }
67
- });
32
+ async keys() {
33
+ try {
34
+ await n();
35
+ const r = await e.keys();
36
+ return Array.isArray(r) ? r : (i.warn("[Storage:keys] Invalid keys response:", r), []);
37
+ } catch (r) {
38
+ return a(r, { returnValue: [] });
39
+ }
68
40
  },
69
- getLogLink(r) {
70
- return a(this, null, function* () {
71
- try {
72
- return `${l.CYBERSKILL_STORAGE_DIRECTORY} (key: ${r})`;
73
- } catch (t) {
74
- return s(t, { returnValue: null });
75
- }
76
- });
41
+ async getLogLink(r) {
42
+ try {
43
+ return `${s.CYBERSKILL_STORAGE_DIRECTORY} (key: ${r})`;
44
+ } catch (t) {
45
+ return a(t, { returnValue: null });
46
+ }
77
47
  }
78
48
  };
79
49
  export {
80
- L as storage
50
+ m as storage
81
51
  };
@@ -1,4 +1,4 @@
1
- import { E as p, c as e, u as d } from "../../../upload.util-D4aUdmPo.js";
1
+ import { E as p, createUploadConfig as e, upload as d } from "./upload.util.js";
2
2
  export {
3
3
  p as E_UploadType,
4
4
  e as createUploadConfig,
@@ -1,8 +1,127 @@
1
- import "../fs/fs.util.js";
2
- import "../../../path.constant-CvSr0Rrx.js";
3
- import "../path/path.util.js";
4
- import { c as i, u as m } from "../../../upload.util-D4aUdmPo.js";
1
+ import { dirname as w } from "../path/path.util.js";
2
+ import { pathExistsSync as E, mkdirSync as x, createWriteStream as p } from "../fs/fs.util.js";
3
+ var n = /* @__PURE__ */ ((e) => (e.IMAGE = "IMAGE", e.VIDEO = "VIDEO", e.DOCUMENT = "DOCUMENT", e.OTHER = "OTHER", e))(n || {});
4
+ async function v(e) {
5
+ return new Promise((s, t) => {
6
+ let i = 0;
7
+ e.on("data", (a) => {
8
+ i += a.length;
9
+ }), e.on("end", () => s(i)), e.on("error", t);
10
+ });
11
+ }
12
+ function z(e, s) {
13
+ const t = e.lastIndexOf(".");
14
+ if (t === -1)
15
+ return !1;
16
+ const i = e.substring(t + 1).toLowerCase();
17
+ return s.includes(i);
18
+ }
19
+ function I(e, s, t) {
20
+ const { filename: i, fileSize: a } = e, o = s[t], { allowedExtensions: r, sizeLimit: l } = o;
21
+ if (!z(i, r))
22
+ return {
23
+ isValid: !1,
24
+ error: `File extension not allowed for ${t.toLowerCase()} files. Allowed extensions: ${r.join(", ")}`
25
+ };
26
+ if (a !== void 0 && a > l) {
27
+ const f = Math.round(l / 1048576);
28
+ return {
29
+ isValid: !1,
30
+ error: `File size exceeds limit for ${t.toLowerCase()} files. Maximum size: ${f}MB`
31
+ };
32
+ }
33
+ return { isValid: !0 };
34
+ }
35
+ function L(e) {
36
+ return { ...{
37
+ [n.IMAGE]: {
38
+ allowedExtensions: ["jpg", "jpeg", "png", "gif", "webp", "svg"],
39
+ sizeLimit: 5242880
40
+ // 5MB
41
+ },
42
+ [n.VIDEO]: {
43
+ allowedExtensions: ["mp4", "avi", "mov", "wmv", "flv", "webm"],
44
+ sizeLimit: 524288e3
45
+ // 500MB
46
+ },
47
+ [n.DOCUMENT]: {
48
+ allowedExtensions: ["pdf", "doc", "docx", "txt", "rtf"],
49
+ sizeLimit: 10485760
50
+ // 10MB
51
+ },
52
+ [n.OTHER]: {
53
+ allowedExtensions: ["zip", "rar", "tar", "gz"],
54
+ sizeLimit: 5242880
55
+ // 5MB
56
+ }
57
+ }, ...e };
58
+ }
59
+ async function M(e) {
60
+ const { path: s, file: t, config: i, type: a } = e;
61
+ if (!s || typeof s != "string")
62
+ return {
63
+ success: !1,
64
+ message: "Invalid path provided",
65
+ result: ""
66
+ };
67
+ if (!t || typeof t != "object")
68
+ return {
69
+ success: !1,
70
+ message: "Invalid file provided",
71
+ result: ""
72
+ };
73
+ if (i) {
74
+ const o = [n.IMAGE, n.VIDEO, n.DOCUMENT, n.OTHER];
75
+ for (const r of o) {
76
+ if (!i[r] || !Array.isArray(i[r].allowedExtensions) || i[r].allowedExtensions.length === 0)
77
+ return {
78
+ success: !1,
79
+ message: `Invalid config for ${r.toLowerCase()} files`,
80
+ result: ""
81
+ };
82
+ if (typeof i[r].sizeLimit != "number" || i[r].sizeLimit <= 0)
83
+ return {
84
+ success: !1,
85
+ message: `Invalid size limit for ${r.toLowerCase()} files`,
86
+ result: ""
87
+ };
88
+ }
89
+ }
90
+ try {
91
+ const o = await (await t).file, { filename: r, createReadStream: l } = o;
92
+ if (i) {
93
+ const d = l(), c = await v(d), g = I(
94
+ { filename: r, fileSize: c },
95
+ i,
96
+ a
97
+ );
98
+ if (!g.isValid)
99
+ return {
100
+ success: !1,
101
+ message: g.error || "File validation failed",
102
+ result: ""
103
+ };
104
+ }
105
+ const f = w(s);
106
+ E(f) || x(f, { recursive: !0 });
107
+ const m = l(), u = p(s);
108
+ return m.pipe(u), await new Promise((d, c) => {
109
+ u.on("finish", () => d()), u.on("error", c), m.on("error", c);
110
+ }), {
111
+ success: !0,
112
+ message: "File uploaded successfully",
113
+ result: s
114
+ };
115
+ } catch (o) {
116
+ return {
117
+ success: !1,
118
+ message: o instanceof Error ? o.message : "File upload failed",
119
+ result: ""
120
+ };
121
+ }
122
+ }
5
123
  export {
6
- i as createUploadConfig,
7
- m as upload
124
+ n as E,
125
+ L as createUploadConfig,
126
+ M as upload
8
127
  };
@@ -1,21 +1,23 @@
1
1
  import { ApolloProvider as l } from "@apollo/client/react/react.cjs";
2
2
  import r, { useMemo as m } from "react";
3
- import { ApolloErrorComponent as i } from "../apollo-error/apollo-error.component.js";
4
- import "../apollo-error/apollo-error.context.js";
5
- import { ApolloErrorProvider as n } from "../apollo-error/apollo-error.provider.js";
6
- import { Toaster as p } from "react-hot-toast";
7
- import { ApolloClientProvider as a } from "./apollo-client.context.js";
8
- import { getClient as c } from "./apollo-client.util.js";
9
- function g({
10
- options: e,
3
+ import { ApolloClientProvider as i } from "./apollo-client.context.js";
4
+ import { getClient as n } from "./apollo-client.util.js";
5
+ import { ApolloErrorProvider as p } from "../apollo-error/apollo-error.provider.js";
6
+ import { ApolloErrorComponent as a } from "../apollo-error/apollo-error.component.js";
7
+ import { Toaster as c } from "react-hot-toast";
8
+ import "./apollo-client.constant.js";
9
+ import "@apollo/client/cache/cache.cjs";
10
+ import "@apollo/client/react/hooks/hooks.cjs";
11
+ function _({
12
+ options: o,
11
13
  children: t
12
14
  }) {
13
- const o = m(
14
- () => c(e || {}),
15
- [e]
15
+ const e = m(
16
+ () => n(o || {}),
17
+ [o]
16
18
  );
17
- return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(n, null, /* @__PURE__ */ r.createElement(a, { client: o }, /* @__PURE__ */ r.createElement(l, { client: o }, t)), /* @__PURE__ */ r.createElement(i, null)), /* @__PURE__ */ r.createElement(p, { position: "top-right" }));
19
+ return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(p, null, /* @__PURE__ */ r.createElement(i, { client: e }, /* @__PURE__ */ r.createElement(l, { client: e }, t)), /* @__PURE__ */ r.createElement(a, null)), /* @__PURE__ */ r.createElement(c, { position: "top-right" }));
18
20
  }
19
21
  export {
20
- g as ApolloProvider
22
+ _ as ApolloProvider
21
23
  };
@@ -1,5 +1,5 @@
1
1
  import { ApolloClientOptions, ApolloLink, NormalizedCacheObject, UriFunction } from '@apollo/client';
2
- import { I_Children } from '../../typescript/react.js';
2
+ import { I_Children } from '../../typescript/index.js';
3
3
  export interface I_ApolloOptions extends Omit<ApolloClientOptions<NormalizedCacheObject>, 'cache'> {
4
4
  uri?: string | UriFunction;
5
5
  wsUrl?: string;