@cyberskill/shared 3.10.0 → 3.12.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 (215) hide show
  1. package/dist/config/commitlint/index.d.ts +1 -5
  2. package/dist/config/env/env.util.js.map +1 -1
  3. package/dist/config/env/index.d.ts +1 -3
  4. package/dist/config/eslint/index.d.ts +1 -1198
  5. package/dist/config/graphql-codegen/index.d.ts +1 -2
  6. package/dist/config/index.d.ts +1 -2
  7. package/dist/config/lint-staged/index.d.ts +1 -5
  8. package/dist/config/storybook/index.d.ts +1 -2
  9. package/dist/config/vitest/index.d.ts +1 -3
  10. package/dist/config/vitest/vitest.e2e.d.ts +1 -20
  11. package/dist/config/vitest/vitest.e2e.js +1 -1
  12. package/dist/config/vitest/vitest.unit.d.ts +1 -22
  13. package/dist/config/vitest/vitest.unit.js +1 -1
  14. package/dist/constant/index.d.ts +1 -5
  15. package/dist/constant/response-status.js.map +1 -1
  16. package/dist/node/apollo-server/index.d.ts +1 -2
  17. package/dist/node/cli/index.d.ts +1 -2
  18. package/dist/node/command/index.d.ts +1 -2
  19. package/dist/node/express/express.util.js.map +1 -1
  20. package/dist/node/express/index.d.ts +1 -2
  21. package/dist/node/fs/index.d.ts +1 -2
  22. package/dist/node/log/index.d.ts +1 -2
  23. package/dist/node/mongo/index.d.ts +1 -6
  24. package/dist/node/mongo/mongo.controller.helpers.js +20 -0
  25. package/dist/node/mongo/mongo.controller.helpers.js.map +1 -0
  26. package/dist/node/mongo/mongo.controller.native.js +65 -93
  27. package/dist/node/mongo/mongo.controller.native.js.map +1 -1
  28. package/dist/node/mongo/mongo.util.js.map +1 -1
  29. package/dist/node/package/index.d.ts +1 -2
  30. package/dist/node/path/index.d.ts +1 -2
  31. package/dist/node/storage/index.d.ts +1 -3
  32. package/dist/node/storage/index.js +3 -3
  33. package/dist/node/storage/storage.constant.js +2 -2
  34. package/dist/node/storage/storage.constant.js.map +1 -1
  35. package/dist/node/storage/storage.util.js +60 -68
  36. package/dist/node/storage/storage.util.js.map +1 -1
  37. package/dist/node/upload/index.d.ts +1 -3
  38. package/dist/node/upload/upload.type.js.map +1 -1
  39. package/dist/node/upload/upload.util.js +10 -2
  40. package/dist/node/upload/upload.util.js.map +1 -1
  41. package/dist/node/ws/index.d.ts +1 -2
  42. package/dist/node_modules/.pnpm/vitest@4.1.2_@types_node@25.5.0_jsdom@29.0.1_@noble_hashes@1.8.0__vite@8.0.3_@types_nod_0827261ede788764a5d99ac6bdf44bde/node_modules/vitest/dist/config.js +8 -0
  43. package/dist/node_modules/.pnpm/{vitest@4.1.0_@types_node@25.5.0_jsdom@29.0.0_@noble_hashes@1.8.0__vite@8.0.1_@types_nod_36acd00c2670b611b011192023dc5bd9 → vitest@4.1.2_@types_node@25.5.0_jsdom@29.0.1_@noble_hashes@1.8.0__vite@8.0.3_@types_nod_0827261ede788764a5d99ac6bdf44bde}/node_modules/vitest/dist/config.js.map +1 -1
  44. package/dist/react/apollo-client/index.d.ts +1 -9
  45. package/dist/react/apollo-client/links/index.d.ts +1 -1
  46. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.d.ts +1 -16
  47. package/dist/react/apollo-client-nextjs/index.d.ts +1 -2
  48. package/dist/react/apollo-error/apollo-error.component.js +6 -2
  49. package/dist/react/apollo-error/apollo-error.component.js.map +1 -1
  50. package/dist/react/apollo-error/index.d.ts +1 -6
  51. package/dist/react/i18next/index.d.ts +1 -2
  52. package/dist/react/loading/index.d.ts +1 -5
  53. package/dist/react/log/index.d.ts +1 -2
  54. package/dist/react/next-intl/index.d.ts +1 -6
  55. package/dist/react/storage/index.d.ts +1 -2
  56. package/dist/react/storage/storage.hook.js.map +1 -1
  57. package/dist/react/storage/storage.util.js +15 -10
  58. package/dist/react/storage/storage.util.js.map +1 -1
  59. package/dist/react/toast/index.d.ts +1 -1
  60. package/dist/react/userback/index.d.ts +1 -2
  61. package/dist/src/config/commitlint/index.d.ts +5 -0
  62. package/dist/{config → src/config}/config.type.d.ts +1 -1
  63. package/dist/{config → src/config}/config.util.d.ts +1 -1
  64. package/dist/src/config/env/index.d.ts +3 -0
  65. package/dist/src/config/eslint/index.d.ts +1198 -0
  66. package/dist/src/config/graphql-codegen/index.d.ts +2 -0
  67. package/dist/src/config/index.d.ts +2 -0
  68. package/dist/src/config/lint-staged/index.d.ts +5 -0
  69. package/dist/src/config/storybook/index.d.ts +2 -0
  70. package/dist/src/config/vitest/index.d.ts +3 -0
  71. package/dist/src/config/vitest/vitest.e2e.d.ts +20 -0
  72. package/dist/src/config/vitest/vitest.unit.d.ts +22 -0
  73. package/dist/src/constant/index.d.ts +5 -0
  74. package/dist/{constant → src/constant}/response-status.d.ts +4 -0
  75. package/dist/src/node/apollo-server/index.d.ts +2 -0
  76. package/dist/src/node/cli/index.d.ts +2 -0
  77. package/dist/src/node/command/index.d.ts +2 -0
  78. package/dist/{node → src/node}/express/express.util.d.ts +6 -0
  79. package/dist/src/node/express/index.d.ts +2 -0
  80. package/dist/src/node/fs/index.d.ts +2 -0
  81. package/dist/src/node/log/index.d.ts +2 -0
  82. package/dist/{node → src/node}/log/log.type.d.ts +2 -2
  83. package/dist/{node → src/node}/log/log.util.d.ts +1 -1
  84. package/dist/src/node/mongo/index.d.ts +6 -0
  85. package/dist/src/node/mongo/mongo.controller.helpers.d.ts +43 -0
  86. package/dist/{node → src/node}/mongo/mongo.controller.mongoose.d.ts +1 -1
  87. package/dist/{node → src/node}/mongo/mongo.controller.native.d.ts +1 -1
  88. package/dist/{node → src/node}/mongo/mongo.controller.type.d.ts +1 -1
  89. package/dist/src/node/package/index.d.ts +2 -0
  90. package/dist/{node → src/node}/package/package.util.d.ts +1 -1
  91. package/dist/src/node/path/index.d.ts +2 -0
  92. package/dist/src/node/storage/index.d.ts +3 -0
  93. package/dist/src/node/storage/storage.constant.d.ts +1 -0
  94. package/dist/src/node/storage/storage.type.d.ts +3 -0
  95. package/dist/{node → src/node}/storage/storage.util.d.ts +1 -1
  96. package/dist/src/node/upload/index.d.ts +3 -0
  97. package/dist/{node → src/node}/upload/upload.type.d.ts +2 -0
  98. package/dist/{node → src/node}/upload/upload.util.d.ts +1 -1
  99. package/dist/src/node/ws/index.d.ts +2 -0
  100. package/dist/{react → src/react}/apollo-client/apollo-client.type.d.ts +1 -1
  101. package/dist/src/react/apollo-client/index.d.ts +9 -0
  102. package/dist/src/react/apollo-client/links/index.d.ts +1 -0
  103. package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.rsc.d.ts +16 -0
  104. package/dist/src/react/apollo-client-nextjs/index.d.ts +2 -0
  105. package/dist/src/react/apollo-error/index.d.ts +6 -0
  106. package/dist/src/react/i18next/index.d.ts +2 -0
  107. package/dist/src/react/loading/index.d.ts +5 -0
  108. package/dist/{react → src/react}/loading/loading.provider.d.ts +1 -1
  109. package/dist/src/react/log/index.d.ts +2 -0
  110. package/dist/src/react/log/log.type.d.ts +1 -0
  111. package/dist/{react → src/react}/log/log.util.d.ts +1 -1
  112. package/dist/src/react/next-intl/index.d.ts +6 -0
  113. package/dist/{react → src/react}/next-intl/next-intl.hoc.d.ts +1 -1
  114. package/dist/{react → src/react}/next-intl/next-intl.type.d.ts +1 -1
  115. package/dist/src/react/storage/index.d.ts +2 -0
  116. package/dist/{react → src/react}/storage/storage.hook.d.ts +2 -2
  117. package/dist/{react → src/react}/storage/storage.util.d.ts +6 -7
  118. package/dist/src/react/toast/index.d.ts +1 -0
  119. package/dist/src/react/userback/index.d.ts +2 -0
  120. package/dist/src/typescript/index.d.ts +5 -0
  121. package/dist/{util → src/util}/common/common.util.d.ts +15 -2
  122. package/dist/src/util/common/index.d.ts +5 -0
  123. package/dist/src/util/index.d.ts +9 -0
  124. package/dist/src/util/log/index.d.ts +2 -0
  125. package/dist/{util → src/util}/log/log.util.d.ts +1 -1
  126. package/dist/src/util/object/index.d.ts +4 -0
  127. package/dist/{util → src/util}/object/object.util.d.ts +7 -3
  128. package/dist/src/util/serializer/index.d.ts +2 -0
  129. package/dist/src/util/string/index.d.ts +5 -0
  130. package/dist/src/util/validate/index.d.ts +4 -0
  131. package/dist/typescript/index.d.ts +1 -5
  132. package/dist/util/common/common.util.js +22 -9
  133. package/dist/util/common/common.util.js.map +1 -1
  134. package/dist/util/common/index.d.ts +1 -5
  135. package/dist/util/common/index.js +2 -2
  136. package/dist/util/index.d.ts +1 -9
  137. package/dist/util/index.js +7 -7
  138. package/dist/util/log/index.d.ts +1 -2
  139. package/dist/util/object/index.d.ts +1 -4
  140. package/dist/util/object/object.util.js +5 -3
  141. package/dist/util/object/object.util.js.map +1 -1
  142. package/dist/util/serializer/index.d.ts +1 -2
  143. package/dist/util/serializer/serializer.util.js +10 -10
  144. package/dist/util/serializer/serializer.util.js.map +1 -1
  145. package/dist/util/string/index.d.ts +1 -5
  146. package/dist/util/validate/index.d.ts +1 -4
  147. package/package.json +23 -24
  148. package/dist/node/storage/storage.constant.d.ts +0 -4
  149. package/dist/node/storage/storage.type.d.ts +0 -14
  150. package/dist/node_modules/.pnpm/vitest@4.1.0_@types_node@25.5.0_jsdom@29.0.0_@noble_hashes@1.8.0__vite@8.0.1_@types_nod_36acd00c2670b611b011192023dc5bd9/node_modules/vitest/dist/config.js +0 -8
  151. package/dist/react/log/log.type.d.ts +0 -1
  152. /package/dist/{config → src/config}/env/env.constant.d.ts +0 -0
  153. /package/dist/{config → src/config}/env/env.type.d.ts +0 -0
  154. /package/dist/{config → src/config}/env/env.util.d.ts +0 -0
  155. /package/dist/{config → src/config}/graphql-codegen/graphql-codegen.type.d.ts +0 -0
  156. /package/dist/{config → src/config}/graphql-codegen/graphql-codegen.util.d.ts +0 -0
  157. /package/dist/{config → src/config}/storybook/storybook.main.d.ts +0 -0
  158. /package/dist/{config → src/config}/storybook/storybook.preview.d.ts +0 -0
  159. /package/dist/{config → src/config}/vitest/vitest.unit.setup.d.ts +0 -0
  160. /package/dist/{constant → src/constant}/common.d.ts +0 -0
  161. /package/dist/{node → src/node}/apollo-server/apollo-server.type.d.ts +0 -0
  162. /package/dist/{node → src/node}/apollo-server/apollo-server.util.d.ts +0 -0
  163. /package/dist/{node → src/node}/command/command.type.d.ts +0 -0
  164. /package/dist/{node → src/node}/command/command.util.d.ts +0 -0
  165. /package/dist/{node → src/node}/express/express.type.d.ts +0 -0
  166. /package/dist/{node → src/node}/fs/fs.type.d.ts +0 -0
  167. /package/dist/{node → src/node}/fs/fs.util.d.ts +0 -0
  168. /package/dist/{node → src/node}/mongo/mongo.constant.d.ts +0 -0
  169. /package/dist/{node → src/node}/mongo/mongo.controller.d.ts +0 -0
  170. /package/dist/{node → src/node}/mongo/mongo.dynamic-populate.d.ts +0 -0
  171. /package/dist/{node → src/node}/mongo/mongo.internal-types.d.ts +0 -0
  172. /package/dist/{node → src/node}/mongo/mongo.populate.d.ts +0 -0
  173. /package/dist/{node → src/node}/mongo/mongo.type.d.ts +0 -0
  174. /package/dist/{node → src/node}/mongo/mongo.util.d.ts +0 -0
  175. /package/dist/{node → src/node}/package/package.type.d.ts +0 -0
  176. /package/dist/{node → src/node}/path/path.constant.d.ts +0 -0
  177. /package/dist/{node → src/node}/path/path.util.d.ts +0 -0
  178. /package/dist/{node → src/node}/upload/upload.constant.d.ts +0 -0
  179. /package/dist/{node → src/node}/ws/ws.type.d.ts +0 -0
  180. /package/dist/{node → src/node}/ws/ws.util.d.ts +0 -0
  181. /package/dist/{react → src/react}/apollo-client/apollo-client.component.d.ts +0 -0
  182. /package/dist/{react → src/react}/apollo-client/apollo-client.constant.d.ts +0 -0
  183. /package/dist/{react → src/react}/apollo-client/apollo-client.context.d.ts +0 -0
  184. /package/dist/{react → src/react}/apollo-client/apollo-client.hook.d.ts +0 -0
  185. /package/dist/{react → src/react}/apollo-client/apollo-client.util.d.ts +0 -0
  186. /package/dist/{react → src/react}/apollo-client/links/upload.d.ts +0 -0
  187. /package/dist/{react → src/react}/apollo-client-nextjs/apollo-client-nextjs.component.d.ts +0 -0
  188. /package/dist/{react → src/react}/apollo-client-nextjs/apollo-client-nextjs.util.d.ts +0 -0
  189. /package/dist/{react → src/react}/apollo-error/apollo-error.component.d.ts +0 -0
  190. /package/dist/{react → src/react}/apollo-error/apollo-error.context.d.ts +0 -0
  191. /package/dist/{react → src/react}/apollo-error/apollo-error.hook.d.ts +0 -0
  192. /package/dist/{react → src/react}/apollo-error/apollo-error.provider.d.ts +0 -0
  193. /package/dist/{react → src/react}/apollo-error/apollo-error.type.d.ts +0 -0
  194. /package/dist/{react → src/react}/apollo-error/apollo-error.util.d.ts +0 -0
  195. /package/dist/{react → src/react}/i18next/i18next.hook.d.ts +0 -0
  196. /package/dist/{react → src/react}/i18next/i18next.util.d.ts +0 -0
  197. /package/dist/{react → src/react}/loading/loading.component.d.ts +0 -0
  198. /package/dist/{react → src/react}/loading/loading.context.d.ts +0 -0
  199. /package/dist/{react → src/react}/loading/loading.hook.d.ts +0 -0
  200. /package/dist/{react → src/react}/loading/loading.type.d.ts +0 -0
  201. /package/dist/{react → src/react}/next-intl/next-intl.constant.d.ts +0 -0
  202. /package/dist/{react → src/react}/next-intl/next-intl.context.d.ts +0 -0
  203. /package/dist/{react → src/react}/next-intl/next-intl.hook.d.ts +0 -0
  204. /package/dist/{react → src/react}/next-intl/next-intl.provider.d.ts +0 -0
  205. /package/dist/{react → src/react}/userback/userback.component.d.ts +0 -0
  206. /package/dist/{react → src/react}/userback/userback.type.d.ts +0 -0
  207. /package/dist/{typescript → src/typescript}/common.type.d.ts +0 -0
  208. /package/dist/{typescript → src/typescript}/react.type.d.ts +0 -0
  209. /package/dist/{util → src/util}/common/common.type.d.ts +0 -0
  210. /package/dist/{util → src/util}/log/log.type.d.ts +0 -0
  211. /package/dist/{util → src/util}/serializer/serializer.type.d.ts +0 -0
  212. /package/dist/{util → src/util}/serializer/serializer.util.d.ts +0 -0
  213. /package/dist/{util → src/util}/string/string.type.d.ts +0 -0
  214. /package/dist/{util → src/util}/string/string.util.d.ts +0 -0
  215. /package/dist/{util → src/util}/validate/validate.util.d.ts +0 -0
@@ -0,0 +1,2 @@
1
+ export * from './graphql-codegen.type.js';
2
+ export * from './graphql-codegen.util.js';
@@ -0,0 +1,2 @@
1
+ export * from './config.type.js';
2
+ export * from './config.util.js';
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ '*.ts': () => string;
3
+ '*': string[];
4
+ };
5
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export * from './storybook.main.js';
2
+ export * from './storybook.preview.js';
@@ -0,0 +1,3 @@
1
+ export * from './vitest.e2e.js';
2
+ export * from './vitest.unit.js';
3
+ export * from './vitest.unit.setup.js';
@@ -0,0 +1,20 @@
1
+ import { UserConfig } from 'vite';
2
+ /**
3
+ * Creates a Vitest configuration for end-to-end testing with browser automation.
4
+ * This function generates a Vitest configuration specifically designed for E2E testing
5
+ * using Playwright with multiple browser instances. It includes React support and
6
+ * browser automation capabilities for comprehensive end-to-end testing.
7
+ *
8
+ * The configuration includes:
9
+ * - React SWC plugin for fast React compilation
10
+ * - Browser automation with Playwright provider
11
+ * - Multiple browser instances (Chromium, Firefox, WebKit)
12
+ * - E2E test file pattern matching
13
+ * - Configurable options merging
14
+ *
15
+ * @param options - Additional Vite configuration options to merge with the E2E config.
16
+ * @returns A Vitest configuration object optimized for end-to-end testing with browser automation.
17
+ */
18
+ export declare function vitestE2E(options: UserConfig): UserConfig;
19
+ declare const _default: UserConfig;
20
+ export default _default;
@@ -0,0 +1,22 @@
1
+ import { UserConfig } from 'vite';
2
+ /**
3
+ * Creates a Vitest configuration for unit testing with React support.
4
+ * This function generates a Vitest configuration specifically designed for unit testing
5
+ * React components and JavaScript/TypeScript modules. It includes JSDOM environment
6
+ * for DOM simulation and comprehensive testing setup.
7
+ *
8
+ * The configuration includes:
9
+ * - React SWC plugin for fast React compilation
10
+ * - JSDOM environment for DOM simulation
11
+ * - Global test functions availability
12
+ * - VM threads pool for parallel test execution
13
+ * - Unit test file pattern matching
14
+ * - Setup files for testing library configuration
15
+ * - Configurable options merging
16
+ *
17
+ * @param options - Additional Vite configuration options to merge with the unit test config.
18
+ * @returns A Vitest configuration object optimized for unit testing with React and DOM support.
19
+ */
20
+ export declare function vitestUnit(options: UserConfig): UserConfig;
21
+ declare const _default: UserConfig;
22
+ export default _default;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Re-exports all common constants for shared usage across the codebase.
3
+ */
4
+ export * from './common.js';
5
+ export * from './response-status.js';
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @deprecated Prefer `GRAPHQL_RESPONSE_STATUS` (string codes) or `HTTP_RESPONSE_STATUS` (numeric codes)
3
+ * for better type safety. Direct use of `RESPONSE_STATUS` yields a union type `number | string` for `CODE`.
4
+ */
1
5
  export declare const RESPONSE_STATUS: {
2
6
  readonly GRAPHQL_PARSE_FAILED: {
3
7
  readonly CODE: "GRAPHQL_PARSE_FAILED";
@@ -0,0 +1,2 @@
1
+ export * from './apollo-server.type.js';
2
+ export * from './apollo-server.util.js';
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './command.type.js';
2
+ export * from './command.util.js';
@@ -36,6 +36,12 @@ export declare function createCors<T extends T_CorsType>(options: T_CorsOptions<
36
36
  * This function creates an Express session middleware that can be used to handle user sessions
37
37
  * with the provided session options including secret, cookie settings, and storage configuration.
38
38
  *
39
+ * @remarks
40
+ * **CSRF Warning:** This middleware sets `SameSite=Lax` by default, which mitigates but does NOT
41
+ * fully prevent CSRF attacks for non-GET state-changing requests via top-level navigations.
42
+ * Applications should integrate a dedicated CSRF token middleware (e.g., `csrf-csrf` or
43
+ * `csrf-sync`) in addition to this session middleware for complete protection.
44
+ *
39
45
  * @param options - Session configuration options including secret, cookie settings, and storage.
40
46
  * @returns A session middleware function ready to be used in Express applications.
41
47
  */
@@ -0,0 +1,2 @@
1
+ export * from './express.type.js';
2
+ export * from './express.util.js';
@@ -0,0 +1,2 @@
1
+ export * from './fs.type.js';
2
+ export * from './fs.util.js';
@@ -0,0 +1,2 @@
1
+ export * from './log.type.js';
2
+ export * from './log.util.js';
@@ -1,5 +1,5 @@
1
- import { I_Log as I_LogCommon } from '../../typescript/index.js';
2
- export type { I_CatchErrorOptions } from '../../util/log/index.js';
1
+ import { I_Log as I_LogCommon } from '../../../typescript/index.js';
2
+ export type { I_CatchErrorOptions } from '../../../util/log/index.js';
3
3
  /**
4
4
  * Enum representing the type of issues for logging and error handling.
5
5
  * - Error: Represents an error issue.
@@ -1,4 +1,4 @@
1
- import { I_Return } from '../../typescript/index.js';
1
+ import { I_Return } from '../../../typescript/index.js';
2
2
  import { I_CatchErrorOptions, I_Log, I_ThrowError } from './log.type.js';
3
3
  /**
4
4
  * Throws a standardized error with optional status information and type specification.
@@ -0,0 +1,6 @@
1
+ export * from './mongo.constant.js';
2
+ export * from './mongo.controller.js';
3
+ export * from './mongo.dynamic-populate.js';
4
+ export * from './mongo.populate.js';
5
+ export * from './mongo.type.js';
6
+ export * from './mongo.util.js';
@@ -0,0 +1,43 @@
1
+ import { I_Return } from '../../../typescript/index.js';
2
+ /**
3
+ * Shared helper functions for MongoDB controllers.
4
+ *
5
+ * These helpers standardize response formatting and error patterns
6
+ * across both the Mongoose and native MongoDB controllers, reducing
7
+ * code duplication and ensuring consistency.
8
+ */
9
+ /**
10
+ * Creates a standardized success response wrapper.
11
+ *
12
+ * @param result - The operation result to wrap.
13
+ * @returns A standardized success response.
14
+ */
15
+ export declare function wrapSuccess<T>(result: T): I_Return<T>;
16
+ /**
17
+ * Creates a standardized success response with a "truncated" flag.
18
+ *
19
+ * @param result - The operation result to wrap.
20
+ * @returns A standardized success response with truncated: true.
21
+ */
22
+ export declare function wrapTruncated<T>(result: T): I_Return<T>;
23
+ /**
24
+ * Creates a standardized "not found" failure response.
25
+ *
26
+ * @param modelName - The model/collection name for the error message.
27
+ * @returns A standardized not-found failure response.
28
+ */
29
+ export declare function wrapNotFound<T>(modelName: string): I_Return<T>;
30
+ /**
31
+ * Creates a standardized internal error failure response.
32
+ *
33
+ * @param message - The error message.
34
+ * @returns A standardized internal error failure response.
35
+ */
36
+ export declare function wrapError<T>(message: string): I_Return<T>;
37
+ /**
38
+ * Creates a standardized "bad request" failure response.
39
+ *
40
+ * @param message - The error message.
41
+ * @returns A standardized bad request failure response.
42
+ */
43
+ export declare function wrapBadRequest<T>(message: string): I_Return<T>;
@@ -1,4 +1,4 @@
1
- import { I_Return } from '../../typescript/index.js';
1
+ import { I_Return } from '../../../typescript/index.js';
2
2
  import { C_Document, I_DeleteOptionsExtended, I_ExtendedModel, I_Input_CheckSlug, I_Input_CreateSlug, I_Input_GenerateSlug, I_PaginateOptionsWithPopulate, I_UpdateOptionsExtended, T_AggregatePaginateResult, T_DeleteResult, T_Input_Populate, T_InsertManyOptions, T_PaginateResult, T_PipelineStage, T_ProjectionType, T_QueryFilter, T_QueryOptions, T_UpdateQuery, T_UpdateResult } from './mongo.type.js';
3
3
  /**
4
4
  * Mongoose controller for database operations with advanced features.
@@ -1,4 +1,4 @@
1
- import { I_Return } from '../../typescript/index.js';
1
+ import { I_Return } from '../../../typescript/index.js';
2
2
  import { C_Db, C_Document, T_DeleteResult, T_Filter, T_UpdateResult, T_WithId } from './mongo.type.js';
3
3
  /**
4
4
  * MongoDB native driver controller for direct database operations.
@@ -1,4 +1,4 @@
1
- import { I_Return } from '../../typescript/index.js';
1
+ import { I_Return } from '../../../typescript/index.js';
2
2
  import { T_DeleteResult, T_UpdateResult, T_WithId } from './mongo.type.js';
3
3
  /**
4
4
  * Shared controller interface for MongoDB operations.
@@ -0,0 +1,2 @@
1
+ export * from './package.type.js';
2
+ export * from './package.util.js';
@@ -1,4 +1,4 @@
1
- import { I_Return } from '../../typescript/index.js';
1
+ import { I_Return } from '../../../typescript/index.js';
2
2
  import { I_PackageInfo, I_PackageInput } from './package.type.js';
3
3
  /**
4
4
  * Fetches the latest version of a package from the npm registry.
@@ -0,0 +1,2 @@
1
+ export * from './path.constant.js';
2
+ export * from './path.util.js';
@@ -0,0 +1,3 @@
1
+ export * from './storage.constant.js';
2
+ export * from './storage.type.js';
3
+ export * from './storage.util.js';
@@ -0,0 +1 @@
1
+ export declare const STORAGE_KEY_EXTENSION = ".json";
@@ -0,0 +1,3 @@
1
+ export interface NodeFsDriverState {
2
+ baseDir: string;
3
+ }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Persistent storage utility object for data persistence across application sessions.
3
- * This object provides methods for storing, retrieving, and managing data using localForage,
3
+ * Uses a filesystem-backed driver that stores JSON-encoded values on disk,
4
4
  * with automatic initialization and error handling.
5
5
  */
6
6
  export declare const storage: {
@@ -0,0 +1,3 @@
1
+ export * from './upload.constant.js';
2
+ export * from './upload.type.js';
3
+ export * from './upload.util.js';
@@ -32,4 +32,6 @@ export interface I_UploadOptions {
32
32
  path: string;
33
33
  type: E_UploadType;
34
34
  config?: I_UploadConfig;
35
+ /** Base directory for path containment validation. When set, the resolved `path` must reside within this directory. */
36
+ baseDir?: string;
35
37
  }
@@ -1,5 +1,5 @@
1
1
  import { ReadableStream } from 'node:stream/web';
2
- import { I_Return } from '../../typescript/index.js';
2
+ import { I_Return } from '../../../typescript/index.js';
3
3
  import { I_UploadConfig, I_UploadFile, I_UploadFileData, I_UploadOptions, I_UploadValidationConfig, E_UploadType } from './upload.type.js';
4
4
  /**
5
5
  * Calculates the size of a file from a readable stream.
@@ -0,0 +1,2 @@
1
+ export * from './ws.type.js';
2
+ export * from './ws.util.js';
@@ -1,7 +1,7 @@
1
1
  import { ApolloClient } from '@apollo/client';
2
2
  import { ApolloLink } from '@apollo/client/link';
3
3
  import { GraphQLError } from 'graphql';
4
- import { I_Children } from '../../typescript/index.js';
4
+ import { I_Children } from '../../../typescript/index.js';
5
5
  export interface I_ApolloOptions extends Omit<ApolloClient.Options, 'link' | 'cache'> {
6
6
  uri?: string;
7
7
  wsUrl?: string;
@@ -0,0 +1,9 @@
1
+ export * from './apollo-client.component.js';
2
+ export * from './apollo-client.constant.js';
3
+ export * from './apollo-client.context.js';
4
+ export * from './apollo-client.hook.js';
5
+ export * from './apollo-client.type.js';
6
+ export * from './apollo-client.util.js';
7
+ export * from './links/index.js';
8
+ export { makeVar } from '@apollo/client/cache';
9
+ export { useApolloClient, useBackgroundQuery, useFragment, useLazyQuery, useLoadableQuery, useMutation, useQuery, useQueryRefHandlers, useReactiveVar, useReadQuery, useSubscription, useSuspenseFragment, useSuspenseQuery } from '@apollo/client/react';
@@ -0,0 +1 @@
1
+ export * from './upload.js';
@@ -0,0 +1,16 @@
1
+ import { I_ApolloOptions } from '../apollo-client/index.js';
2
+ /**
3
+ * Creates a registered Apollo Client factory for Next.js server components.
4
+ * This function creates a client factory that is registered with Next.js for
5
+ * proper server-side rendering support. The factory function ensures that
6
+ * each request gets its own Apollo Client instance, which is essential for
7
+ * SSR compatibility and preventing client state leakage between requests.
8
+ *
9
+ * @param options - Configuration options for the Apollo Client including URI, WebSocket URL, and custom links.
10
+ * @returns A registered Apollo Client factory function that can be used with Next.js server components.
11
+ */
12
+ export declare const makeClient: (options?: I_ApolloOptions) => {
13
+ getClient: () => import('@apollo/client-integration-nextjs').ApolloClient;
14
+ query: <TData = unknown, TVariables extends import('@apollo/client').OperationVariables = import('@apollo/client').OperationVariables>(options: import("@apollo/client").ApolloClient.QueryOptions<TData, TVariables>) => Promise<import("@apollo/client").ApolloClient.QueryResult<import('@apollo/client').MaybeMasked<TData>>>;
15
+ PreloadQuery: import('@apollo/client-integration-nextjs').PreloadQueryComponent;
16
+ };
@@ -0,0 +1,2 @@
1
+ export * from './apollo-client-nextjs.component.js';
2
+ export * from './apollo-client-nextjs.util.js';
@@ -0,0 +1,6 @@
1
+ export * from './apollo-error.component.js';
2
+ export * from './apollo-error.context.js';
3
+ export * from './apollo-error.hook.js';
4
+ export * from './apollo-error.provider.js';
5
+ export * from './apollo-error.type.js';
6
+ export * from './apollo-error.util.js';
@@ -0,0 +1,2 @@
1
+ export * from './i18next.hook.js';
2
+ export * from './i18next.util.js';
@@ -0,0 +1,5 @@
1
+ export * from './loading.component.js';
2
+ export * from './loading.context.js';
3
+ export * from './loading.hook.js';
4
+ export * from './loading.provider.js';
5
+ export * from './loading.type.js';
@@ -1,4 +1,4 @@
1
- import { I_Children } from '../../typescript/index.js';
1
+ import { I_Children } from '../../../typescript/index.js';
2
2
  import * as React from 'react';
3
3
  /**
4
4
  * Provider component that manages loading state and provides loading context.
@@ -0,0 +1,2 @@
1
+ export * from './log.type.js';
2
+ export * from './log.util.js';
@@ -0,0 +1 @@
1
+ export type { I_CatchErrorOptions } from '../../../util/log/index.js';
@@ -1,4 +1,4 @@
1
- import { I_Log, I_Return } from '../../typescript/index.js';
1
+ import { I_Log, I_Return } from '../../../typescript/index.js';
2
2
  import { I_CatchErrorOptions } from './log.type.js';
3
3
  /**
4
4
  * Browser-compatible logging interface using consola.
@@ -0,0 +1,6 @@
1
+ export * from './next-intl.constant.js';
2
+ export * from './next-intl.context.js';
3
+ export * from './next-intl.hoc.js';
4
+ export * from './next-intl.hook.js';
5
+ export * from './next-intl.provider.js';
6
+ export * from './next-intl.type.js';
@@ -1,5 +1,5 @@
1
1
  import { ComponentType } from 'react';
2
- import { I_Children } from '../../typescript/index.js';
2
+ import { I_Children } from '../../../typescript/index.js';
3
3
  import { I_NextIntlLanguage, T_NextIntlMessageList } from './next-intl.type.js';
4
4
  import * as React from 'react';
5
5
  /**
@@ -1,6 +1,6 @@
1
1
  import { Locale } from 'date-fns';
2
2
  import { AbstractIntlMessages, Timezone } from 'next-intl';
3
- import { I_Children } from '../../typescript/index.js';
3
+ import { I_Children } from '../../../typescript/index.js';
4
4
  export interface I_NextIntlLanguage {
5
5
  label: string;
6
6
  value: string;
@@ -0,0 +1,2 @@
1
+ export * from './storage.hook.js';
2
+ export * from './storage.util.js';
@@ -1,7 +1,7 @@
1
- import { I_Serializer } from '../../util/serializer/index.js';
1
+ import { I_Serializer } from '../../../util/serializer/index.js';
2
2
  /**
3
3
  * React hook that provides persistent storage functionality with automatic serialization.
4
- * This hook manages state that persists across browser sessions using localForage,
4
+ * This hook manages state that persists across browser sessions using localStorage,
5
5
  * with automatic serialization/deserialization of complex data types. It provides
6
6
  * a React-friendly interface for storage operations with proper error handling.
7
7
  *
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Browser storage utility object using localForage for cross-browser compatibility.
3
- * This object provides a unified interface for browser storage operations using localForage,
4
- * which automatically chooses the best available storage method (IndexedDB, WebSQL, or localStorage)
5
- * based on browser capabilities. It includes comprehensive error handling and type safety.
2
+ * Browser storage utility object using native localStorage.
3
+ * This object provides a unified interface for browser storage operations
4
+ * with comprehensive error handling and type safety.
5
+ * Values are stored as JSON strings for consistent serialization.
6
6
  */
7
7
  export declare const storage: {
8
8
  /**
@@ -17,11 +17,10 @@ export declare const storage: {
17
17
  /**
18
18
  * Stores a value in browser storage with a unique key.
19
19
  * This method saves data that can be retrieved later using the get method.
20
- * The data is automatically handled by localForage which chooses the optimal
21
- * storage method for the browser environment.
20
+ * The data is automatically serialized to JSON.
22
21
  *
23
22
  * @param key - The unique identifier for the value to store.
24
- * @param value - The data to store (will be automatically handled by localForage).
23
+ * @param value - The data to store (will be automatically serialized to JSON).
25
24
  * @returns A promise that resolves when the storage operation is complete.
26
25
  */
27
26
  set<T = unknown>(key: string, value: T): Promise<void>;
@@ -0,0 +1 @@
1
+ export { toast, Toaster } from 'react-hot-toast';
@@ -0,0 +1,2 @@
1
+ export * from './userback.component.js';
2
+ export * from './userback.type.js';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Re-exports all common TypeScript types for shared usage across the codebase.
3
+ */
4
+ export * from './common.type.js';
5
+ export * from './react.type.js';
@@ -15,8 +15,8 @@ export declare function escapeRegExp(str: string): string;
15
15
  *
16
16
  * Optimization: Uses pre-computed regex and map to perform replacement in a single pass (O(N)),
17
17
  * instead of iterating through all character groups (O(K*N)).
18
- * Removed unnecessary NFD normalization which improves performance and fixes
19
- * matching against NFC target strings.
18
+ * Results are cached in an LRU cache (max 128 entries) to avoid redundant computation
19
+ * for repeated search terms.
20
20
  *
21
21
  * @param str - The string to convert to a regex pattern.
22
22
  * @returns The regex pattern as a string that matches the original string and its accented variations.
@@ -54,7 +54,20 @@ export declare function mapEnvironment(env: I_NodeEnvInput): I_EnvFlags;
54
54
  * Checks if value is object-like (e.g., objects, arrays, etc.), not null.
55
55
  * Re-exported from util for general use across the codebase.
56
56
  *
57
+ * @remarks
58
+ * Returns `true` for arrays, Dates, Maps, Sets, and class instances.
59
+ * Use {@link isPlainObject} when you specifically need to check for plain objects only.
60
+ *
57
61
  * @param value - The value to check.
58
62
  * @returns True if the value is an object and not null.
59
63
  */
60
64
  export declare function isObject(value: unknown): value is object;
65
+ /**
66
+ * Checks if a value is a plain object (created by `{}`, `Object.create(null)`, or `new Object()`).
67
+ * Unlike {@link isObject}, this returns `false` for arrays, Dates, Maps, Sets, RegExps,
68
+ * and other class instances.
69
+ *
70
+ * @param value - The value to check.
71
+ * @returns True if the value is a plain object, false otherwise.
72
+ */
73
+ export declare function isPlainObject(value: unknown): value is Record<string, unknown>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Re-exports all common utility types for shared usage across the codebase.
3
+ */
4
+ export * from './common.type.js';
5
+ export * from './common.util.js';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Re-exports all utility modules for shared usage across the codebase.
3
+ */
4
+ export * from './common/index.js';
5
+ export * from './log/index.js';
6
+ export * from './object/index.js';
7
+ export * from './serializer/index.js';
8
+ export * from './string/index.js';
9
+ export * from './validate/index.js';
@@ -0,0 +1,2 @@
1
+ export type { I_CatchErrorOptions } from './log.type.js';
2
+ export { baseCatchError } from './log.util.js';
@@ -1,4 +1,4 @@
1
- import { I_Return } from '../../typescript/index.js';
1
+ import { I_Return } from '../../../typescript/index.js';
2
2
  import { I_CatchErrorOptions } from './log.type.js';
3
3
  /**
4
4
  * Core error-catching implementation shared between Node and React environments.
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Re-exports all object manipulation utilities.
3
+ */
4
+ export * from './object.util.js';
@@ -32,11 +32,15 @@ export declare function setNestedValue<T>(obj: T, path: (string | number)[], val
32
32
  * Deep clones an object or array.
33
33
  * This function creates a deep copy of the input, recursively cloning objects and arrays.
34
34
  * Primitive values, dates, and other non-plain objects are returned as is (or cloned if supported).
35
- * Note: This implementation focuses on plain objects and arrays. For complex types like Map/Set/Buffer/ObjectId,
36
- * it returns the reference or handles them according to specific logic.
35
+ *
36
+ * @remarks
37
+ * **Non-POJO objects are NOT cloned.** Objects with custom prototypes (e.g., Mongoose ObjectId,
38
+ * class instances, Map, Set, Buffer) are returned **by reference** to preserve driver
39
+ * compatibility. Mutations to these nested references will affect the original.
40
+ * If you need full deep cloning of complex types, use `structuredClone()` or a dedicated library.
37
41
  *
38
42
  * @param obj - The object to clone.
39
- * @returns A deep copy of the object.
43
+ * @returns A deep copy of the object (with non-POJO objects returned by reference).
40
44
  */
41
45
  export declare function deepClone<T>(obj: T): T;
42
46
  /**
@@ -0,0 +1,2 @@
1
+ export * from './serializer.type.js';
2
+ export * from './serializer.util.js';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Re-exports all string manipulation utilities and types.
3
+ */
4
+ export * from './string.type.js';
5
+ export * from './string.util.js';
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Re-exports all validation utilities.
3
+ */
4
+ export * from './validate.util.js';
@@ -1,5 +1 @@
1
- /**
2
- * Re-exports all common TypeScript types for shared usage across the codebase.
3
- */
4
- export * from './common.type.js';
5
- export * from './react.type.js';
1
+ export {}