@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.
- package/dist/config/commitlint/index.d.ts +1 -5
- package/dist/config/env/env.util.js.map +1 -1
- package/dist/config/env/index.d.ts +1 -3
- package/dist/config/eslint/index.d.ts +1 -1198
- package/dist/config/graphql-codegen/index.d.ts +1 -2
- package/dist/config/index.d.ts +1 -2
- package/dist/config/lint-staged/index.d.ts +1 -5
- package/dist/config/storybook/index.d.ts +1 -2
- package/dist/config/vitest/index.d.ts +1 -3
- package/dist/config/vitest/vitest.e2e.d.ts +1 -20
- package/dist/config/vitest/vitest.e2e.js +1 -1
- package/dist/config/vitest/vitest.unit.d.ts +1 -22
- package/dist/config/vitest/vitest.unit.js +1 -1
- package/dist/constant/index.d.ts +1 -5
- package/dist/constant/response-status.js.map +1 -1
- package/dist/node/apollo-server/index.d.ts +1 -2
- package/dist/node/cli/index.d.ts +1 -2
- package/dist/node/command/index.d.ts +1 -2
- package/dist/node/express/express.util.js.map +1 -1
- package/dist/node/express/index.d.ts +1 -2
- package/dist/node/fs/index.d.ts +1 -2
- package/dist/node/log/index.d.ts +1 -2
- package/dist/node/mongo/index.d.ts +1 -6
- package/dist/node/mongo/mongo.controller.helpers.js +20 -0
- package/dist/node/mongo/mongo.controller.helpers.js.map +1 -0
- package/dist/node/mongo/mongo.controller.native.js +65 -93
- package/dist/node/mongo/mongo.controller.native.js.map +1 -1
- package/dist/node/mongo/mongo.util.js.map +1 -1
- package/dist/node/package/index.d.ts +1 -2
- package/dist/node/path/index.d.ts +1 -2
- package/dist/node/storage/index.d.ts +1 -3
- package/dist/node/storage/index.js +3 -3
- package/dist/node/storage/storage.constant.js +2 -2
- package/dist/node/storage/storage.constant.js.map +1 -1
- package/dist/node/storage/storage.util.js +60 -68
- package/dist/node/storage/storage.util.js.map +1 -1
- package/dist/node/upload/index.d.ts +1 -3
- package/dist/node/upload/upload.type.js.map +1 -1
- package/dist/node/upload/upload.util.js +10 -2
- package/dist/node/upload/upload.util.js.map +1 -1
- package/dist/node/ws/index.d.ts +1 -2
- 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
- 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
- package/dist/react/apollo-client/index.d.ts +1 -9
- package/dist/react/apollo-client/links/index.d.ts +1 -1
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.d.ts +1 -16
- package/dist/react/apollo-client-nextjs/index.d.ts +1 -2
- package/dist/react/apollo-error/apollo-error.component.js +6 -2
- package/dist/react/apollo-error/apollo-error.component.js.map +1 -1
- package/dist/react/apollo-error/index.d.ts +1 -6
- package/dist/react/i18next/index.d.ts +1 -2
- package/dist/react/loading/index.d.ts +1 -5
- package/dist/react/log/index.d.ts +1 -2
- package/dist/react/next-intl/index.d.ts +1 -6
- package/dist/react/storage/index.d.ts +1 -2
- package/dist/react/storage/storage.hook.js.map +1 -1
- package/dist/react/storage/storage.util.js +15 -10
- package/dist/react/storage/storage.util.js.map +1 -1
- package/dist/react/toast/index.d.ts +1 -1
- package/dist/react/userback/index.d.ts +1 -2
- package/dist/src/config/commitlint/index.d.ts +5 -0
- package/dist/{config → src/config}/config.type.d.ts +1 -1
- package/dist/{config → src/config}/config.util.d.ts +1 -1
- package/dist/src/config/env/index.d.ts +3 -0
- package/dist/src/config/eslint/index.d.ts +1198 -0
- package/dist/src/config/graphql-codegen/index.d.ts +2 -0
- package/dist/src/config/index.d.ts +2 -0
- package/dist/src/config/lint-staged/index.d.ts +5 -0
- package/dist/src/config/storybook/index.d.ts +2 -0
- package/dist/src/config/vitest/index.d.ts +3 -0
- package/dist/src/config/vitest/vitest.e2e.d.ts +20 -0
- package/dist/src/config/vitest/vitest.unit.d.ts +22 -0
- package/dist/src/constant/index.d.ts +5 -0
- package/dist/{constant → src/constant}/response-status.d.ts +4 -0
- package/dist/src/node/apollo-server/index.d.ts +2 -0
- package/dist/src/node/cli/index.d.ts +2 -0
- package/dist/src/node/command/index.d.ts +2 -0
- package/dist/{node → src/node}/express/express.util.d.ts +6 -0
- package/dist/src/node/express/index.d.ts +2 -0
- package/dist/src/node/fs/index.d.ts +2 -0
- package/dist/src/node/log/index.d.ts +2 -0
- package/dist/{node → src/node}/log/log.type.d.ts +2 -2
- package/dist/{node → src/node}/log/log.util.d.ts +1 -1
- package/dist/src/node/mongo/index.d.ts +6 -0
- package/dist/src/node/mongo/mongo.controller.helpers.d.ts +43 -0
- package/dist/{node → src/node}/mongo/mongo.controller.mongoose.d.ts +1 -1
- package/dist/{node → src/node}/mongo/mongo.controller.native.d.ts +1 -1
- package/dist/{node → src/node}/mongo/mongo.controller.type.d.ts +1 -1
- package/dist/src/node/package/index.d.ts +2 -0
- package/dist/{node → src/node}/package/package.util.d.ts +1 -1
- package/dist/src/node/path/index.d.ts +2 -0
- package/dist/src/node/storage/index.d.ts +3 -0
- package/dist/src/node/storage/storage.constant.d.ts +1 -0
- package/dist/src/node/storage/storage.type.d.ts +3 -0
- package/dist/{node → src/node}/storage/storage.util.d.ts +1 -1
- package/dist/src/node/upload/index.d.ts +3 -0
- package/dist/{node → src/node}/upload/upload.type.d.ts +2 -0
- package/dist/{node → src/node}/upload/upload.util.d.ts +1 -1
- package/dist/src/node/ws/index.d.ts +2 -0
- package/dist/{react → src/react}/apollo-client/apollo-client.type.d.ts +1 -1
- package/dist/src/react/apollo-client/index.d.ts +9 -0
- package/dist/src/react/apollo-client/links/index.d.ts +1 -0
- package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.rsc.d.ts +16 -0
- package/dist/src/react/apollo-client-nextjs/index.d.ts +2 -0
- package/dist/src/react/apollo-error/index.d.ts +6 -0
- package/dist/src/react/i18next/index.d.ts +2 -0
- package/dist/src/react/loading/index.d.ts +5 -0
- package/dist/{react → src/react}/loading/loading.provider.d.ts +1 -1
- package/dist/src/react/log/index.d.ts +2 -0
- package/dist/src/react/log/log.type.d.ts +1 -0
- package/dist/{react → src/react}/log/log.util.d.ts +1 -1
- package/dist/src/react/next-intl/index.d.ts +6 -0
- package/dist/{react → src/react}/next-intl/next-intl.hoc.d.ts +1 -1
- package/dist/{react → src/react}/next-intl/next-intl.type.d.ts +1 -1
- package/dist/src/react/storage/index.d.ts +2 -0
- package/dist/{react → src/react}/storage/storage.hook.d.ts +2 -2
- package/dist/{react → src/react}/storage/storage.util.d.ts +6 -7
- package/dist/src/react/toast/index.d.ts +1 -0
- package/dist/src/react/userback/index.d.ts +2 -0
- package/dist/src/typescript/index.d.ts +5 -0
- package/dist/{util → src/util}/common/common.util.d.ts +15 -2
- package/dist/src/util/common/index.d.ts +5 -0
- package/dist/src/util/index.d.ts +9 -0
- package/dist/src/util/log/index.d.ts +2 -0
- package/dist/{util → src/util}/log/log.util.d.ts +1 -1
- package/dist/src/util/object/index.d.ts +4 -0
- package/dist/{util → src/util}/object/object.util.d.ts +7 -3
- package/dist/src/util/serializer/index.d.ts +2 -0
- package/dist/src/util/string/index.d.ts +5 -0
- package/dist/src/util/validate/index.d.ts +4 -0
- package/dist/typescript/index.d.ts +1 -5
- package/dist/util/common/common.util.js +22 -9
- package/dist/util/common/common.util.js.map +1 -1
- package/dist/util/common/index.d.ts +1 -5
- package/dist/util/common/index.js +2 -2
- package/dist/util/index.d.ts +1 -9
- package/dist/util/index.js +7 -7
- package/dist/util/log/index.d.ts +1 -2
- package/dist/util/object/index.d.ts +1 -4
- package/dist/util/object/object.util.js +5 -3
- package/dist/util/object/object.util.js.map +1 -1
- package/dist/util/serializer/index.d.ts +1 -2
- package/dist/util/serializer/serializer.util.js +10 -10
- package/dist/util/serializer/serializer.util.js.map +1 -1
- package/dist/util/string/index.d.ts +1 -5
- package/dist/util/validate/index.d.ts +1 -4
- package/package.json +23 -24
- package/dist/node/storage/storage.constant.d.ts +0 -4
- package/dist/node/storage/storage.type.d.ts +0 -14
- 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
- package/dist/react/log/log.type.d.ts +0 -1
- /package/dist/{config → src/config}/env/env.constant.d.ts +0 -0
- /package/dist/{config → src/config}/env/env.type.d.ts +0 -0
- /package/dist/{config → src/config}/env/env.util.d.ts +0 -0
- /package/dist/{config → src/config}/graphql-codegen/graphql-codegen.type.d.ts +0 -0
- /package/dist/{config → src/config}/graphql-codegen/graphql-codegen.util.d.ts +0 -0
- /package/dist/{config → src/config}/storybook/storybook.main.d.ts +0 -0
- /package/dist/{config → src/config}/storybook/storybook.preview.d.ts +0 -0
- /package/dist/{config → src/config}/vitest/vitest.unit.setup.d.ts +0 -0
- /package/dist/{constant → src/constant}/common.d.ts +0 -0
- /package/dist/{node → src/node}/apollo-server/apollo-server.type.d.ts +0 -0
- /package/dist/{node → src/node}/apollo-server/apollo-server.util.d.ts +0 -0
- /package/dist/{node → src/node}/command/command.type.d.ts +0 -0
- /package/dist/{node → src/node}/command/command.util.d.ts +0 -0
- /package/dist/{node → src/node}/express/express.type.d.ts +0 -0
- /package/dist/{node → src/node}/fs/fs.type.d.ts +0 -0
- /package/dist/{node → src/node}/fs/fs.util.d.ts +0 -0
- /package/dist/{node → src/node}/mongo/mongo.constant.d.ts +0 -0
- /package/dist/{node → src/node}/mongo/mongo.controller.d.ts +0 -0
- /package/dist/{node → src/node}/mongo/mongo.dynamic-populate.d.ts +0 -0
- /package/dist/{node → src/node}/mongo/mongo.internal-types.d.ts +0 -0
- /package/dist/{node → src/node}/mongo/mongo.populate.d.ts +0 -0
- /package/dist/{node → src/node}/mongo/mongo.type.d.ts +0 -0
- /package/dist/{node → src/node}/mongo/mongo.util.d.ts +0 -0
- /package/dist/{node → src/node}/package/package.type.d.ts +0 -0
- /package/dist/{node → src/node}/path/path.constant.d.ts +0 -0
- /package/dist/{node → src/node}/path/path.util.d.ts +0 -0
- /package/dist/{node → src/node}/upload/upload.constant.d.ts +0 -0
- /package/dist/{node → src/node}/ws/ws.type.d.ts +0 -0
- /package/dist/{node → src/node}/ws/ws.util.d.ts +0 -0
- /package/dist/{react → src/react}/apollo-client/apollo-client.component.d.ts +0 -0
- /package/dist/{react → src/react}/apollo-client/apollo-client.constant.d.ts +0 -0
- /package/dist/{react → src/react}/apollo-client/apollo-client.context.d.ts +0 -0
- /package/dist/{react → src/react}/apollo-client/apollo-client.hook.d.ts +0 -0
- /package/dist/{react → src/react}/apollo-client/apollo-client.util.d.ts +0 -0
- /package/dist/{react → src/react}/apollo-client/links/upload.d.ts +0 -0
- /package/dist/{react → src/react}/apollo-client-nextjs/apollo-client-nextjs.component.d.ts +0 -0
- /package/dist/{react → src/react}/apollo-client-nextjs/apollo-client-nextjs.util.d.ts +0 -0
- /package/dist/{react → src/react}/apollo-error/apollo-error.component.d.ts +0 -0
- /package/dist/{react → src/react}/apollo-error/apollo-error.context.d.ts +0 -0
- /package/dist/{react → src/react}/apollo-error/apollo-error.hook.d.ts +0 -0
- /package/dist/{react → src/react}/apollo-error/apollo-error.provider.d.ts +0 -0
- /package/dist/{react → src/react}/apollo-error/apollo-error.type.d.ts +0 -0
- /package/dist/{react → src/react}/apollo-error/apollo-error.util.d.ts +0 -0
- /package/dist/{react → src/react}/i18next/i18next.hook.d.ts +0 -0
- /package/dist/{react → src/react}/i18next/i18next.util.d.ts +0 -0
- /package/dist/{react → src/react}/loading/loading.component.d.ts +0 -0
- /package/dist/{react → src/react}/loading/loading.context.d.ts +0 -0
- /package/dist/{react → src/react}/loading/loading.hook.d.ts +0 -0
- /package/dist/{react → src/react}/loading/loading.type.d.ts +0 -0
- /package/dist/{react → src/react}/next-intl/next-intl.constant.d.ts +0 -0
- /package/dist/{react → src/react}/next-intl/next-intl.context.d.ts +0 -0
- /package/dist/{react → src/react}/next-intl/next-intl.hook.d.ts +0 -0
- /package/dist/{react → src/react}/next-intl/next-intl.provider.d.ts +0 -0
- /package/dist/{react → src/react}/userback/userback.component.d.ts +0 -0
- /package/dist/{react → src/react}/userback/userback.type.d.ts +0 -0
- /package/dist/{typescript → src/typescript}/common.type.d.ts +0 -0
- /package/dist/{typescript → src/typescript}/react.type.d.ts +0 -0
- /package/dist/{util → src/util}/common/common.type.d.ts +0 -0
- /package/dist/{util → src/util}/log/log.type.d.ts +0 -0
- /package/dist/{util → src/util}/serializer/serializer.type.d.ts +0 -0
- /package/dist/{util → src/util}/serializer/serializer.util.d.ts +0 -0
- /package/dist/{util → src/util}/string/string.type.d.ts +0 -0
- /package/dist/{util → src/util}/string/string.util.d.ts +0 -0
- /package/dist/{util → src/util}/validate/validate.util.d.ts +0 -0
|
@@ -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;
|
|
@@ -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";
|
|
@@ -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
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I_Log as I_LogCommon } from '
|
|
2
|
-
export type { I_CatchErrorOptions } from '
|
|
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 '
|
|
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,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 '
|
|
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 '
|
|
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.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const STORAGE_KEY_EXTENSION = ".json";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Persistent storage utility object for data persistence across application sessions.
|
|
3
|
-
*
|
|
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: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReadableStream } from 'node:stream/web';
|
|
2
|
-
import { I_Return } from '
|
|
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.
|
|
@@ -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 '
|
|
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 @@
|
|
|
1
|
+
export type { I_CatchErrorOptions } from '../../../util/log/index.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
|
-
import { I_Children } from '
|
|
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 '
|
|
3
|
+
import { I_Children } from '../../../typescript/index.js';
|
|
4
4
|
export interface I_NextIntlLanguage {
|
|
5
5
|
label: string;
|
|
6
6
|
value: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { I_Serializer } from '
|
|
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
|
|
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
|
|
3
|
-
* This object provides a unified interface for browser storage operations
|
|
4
|
-
*
|
|
5
|
-
*
|
|
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
|
|
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
|
|
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';
|
|
@@ -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
|
-
*
|
|
19
|
-
*
|
|
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,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';
|
|
@@ -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
|
-
*
|
|
36
|
-
*
|
|
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
|
/**
|