@exyconn/common 2.3.4 → 2.3.5

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.
@@ -3,7 +3,7 @@ import { StatusCode, StatusMessage, statusCode, statusMessage } from './server/e
3
3
  import { LoggerConfig, createLogger, createMorganStream, logger, simpleLogger, stream } from './server/logger/index.mjs';
4
4
  import { DbConnectionOptions, connectDB, disconnectDB, getConnectionStatus } from './server/db/index.mjs';
5
5
  import { AuthRequest, BulkDeleteRequest, ColumnMeta, CrudConfig, JWTPayload, OrgRequest, PaginatedRequest, PaginatedResponse, PaginatedResult, PaginationMeta, ParsedQuery, SortConfig, SortOrder, authenticateApiKey, authenticateJWT, buildDeleteFilter, createBulkDeleteHandler, createCrudControllers, createPaginationMiddleware, extractOrganization, extractSchemaMeta, optionalAuthenticateJWT, parseBulkDelete, queryPagination, queryParser, requireOrganization } from './server/middleware/index.mjs';
6
- import { FilterOptions, PackageCheckResult, PackageJson, PackageVersion, PaginationOptions, PaginationResult, buildFilter, buildPagination, buildPaginationMeta, checkPackageServer, formatPackageCheckResult, generateNcuCommand, omitFields, packageCheckServer, pickFields, printPackageCheckSummary, sanitizeDocument, sanitizeUser } from './server/utils/index.mjs';
6
+ import { FilterOptions, HealthConfig, HealthResponse, PackageCheckResult, PackageJson, PackageVersion, PaginationOptions, PaginationResult, buildFilter, buildPagination, buildPaginationMeta, checkPackageServer, createHealthHandler, createRootHandler, formatPackageCheckResult, generateHealthResponse, generateNcuCommand, omitFields, packageCheckServer, pickFields, printPackageCheckSummary, sanitizeDocument, sanitizeUser } from './server/utils/index.mjs';
7
7
  import { AppConfig, AuthConfig, ConfigBuilder, CorsConfig, CorsOriginsConfig, DEFAULT_AUTH_CONFIG, DEFAULT_CORS_CONFIG, DEFAULT_CORS_ORIGINS, DEFAULT_DATABASE_CONFIG, DEFAULT_LOGGING_CONFIG, DEFAULT_RATE_LIMIT_CONFIG, DEFAULT_RATE_LIMIT_TIERS, DEFAULT_SERVER_CONFIG, DatabaseConfig, EXYCONN_CORS_CONFIG, Environment, LogLevel, LoggingConfig, PERMISSIVE_CORS_CONFIG, RATE_LIMIT_CONFIG, RateLimitConfig, RateLimitResponse, RateLimitTier, RateLimitTierConfig, RateLimiterBuilder, RateLimiterConfig, STRICT_CORS_CONFIG, ServerConfig, buildConfig, corsOptions, createApiKeyGenerator, createApiRateLimiter, createBrandCorsOptions, createConfig, createCorsOptions, createDdosRateLimiter, createMultiBrandCorsOptions, createPrefixedKeyGenerator, createRateLimiter, createStandardRateLimiter, createStrictRateLimiter, createUserKeyGenerator, ddosProtectionLimiter, defaultKeyGenerator, getDatabaseOptions, isDevelopment, isProduction, isTest, rateLimiter, standardRateLimiter, strictRateLimiter } from './server/configs/index.mjs';
8
8
 
9
9
  declare const index_ApiResponse: typeof ApiResponse;
@@ -30,6 +30,8 @@ declare const index_DbConnectionOptions: typeof DbConnectionOptions;
30
30
  declare const index_EXYCONN_CORS_CONFIG: typeof EXYCONN_CORS_CONFIG;
31
31
  declare const index_Environment: typeof Environment;
32
32
  declare const index_FilterOptions: typeof FilterOptions;
33
+ declare const index_HealthConfig: typeof HealthConfig;
34
+ declare const index_HealthResponse: typeof HealthResponse;
33
35
  declare const index_JWTPayload: typeof JWTPayload;
34
36
  declare const index_LogLevel: typeof LogLevel;
35
37
  declare const index_LoggerConfig: typeof LoggerConfig;
@@ -80,12 +82,14 @@ declare const index_createConfig: typeof createConfig;
80
82
  declare const index_createCorsOptions: typeof createCorsOptions;
81
83
  declare const index_createCrudControllers: typeof createCrudControllers;
82
84
  declare const index_createDdosRateLimiter: typeof createDdosRateLimiter;
85
+ declare const index_createHealthHandler: typeof createHealthHandler;
83
86
  declare const index_createLogger: typeof createLogger;
84
87
  declare const index_createMorganStream: typeof createMorganStream;
85
88
  declare const index_createMultiBrandCorsOptions: typeof createMultiBrandCorsOptions;
86
89
  declare const index_createPaginationMiddleware: typeof createPaginationMiddleware;
87
90
  declare const index_createPrefixedKeyGenerator: typeof createPrefixedKeyGenerator;
88
91
  declare const index_createRateLimiter: typeof createRateLimiter;
92
+ declare const index_createRootHandler: typeof createRootHandler;
89
93
  declare const index_createStandardRateLimiter: typeof createStandardRateLimiter;
90
94
  declare const index_createStrictRateLimiter: typeof createStrictRateLimiter;
91
95
  declare const index_createUserKeyGenerator: typeof createUserKeyGenerator;
@@ -99,6 +103,7 @@ declare const index_extractOrganization: typeof extractOrganization;
99
103
  declare const index_extractSchemaMeta: typeof extractSchemaMeta;
100
104
  declare const index_forbiddenResponse: typeof forbiddenResponse;
101
105
  declare const index_formatPackageCheckResult: typeof formatPackageCheckResult;
106
+ declare const index_generateHealthResponse: typeof generateHealthResponse;
102
107
  declare const index_generateNcuCommand: typeof generateNcuCommand;
103
108
  declare const index_getConnectionStatus: typeof getConnectionStatus;
104
109
  declare const index_getDatabaseOptions: typeof getDatabaseOptions;
@@ -132,7 +137,7 @@ declare const index_successResponseArr: typeof successResponseArr;
132
137
  declare const index_unauthorizedResponse: typeof unauthorizedResponse;
133
138
  declare const index_validationErrorResponse: typeof validationErrorResponse;
134
139
  declare namespace index {
135
- export { index_ApiResponse as ApiResponse, index_AppConfig as AppConfig, index_AuthConfig as AuthConfig, index_AuthRequest as AuthRequest, index_BulkDeleteRequest as BulkDeleteRequest, index_ColumnMeta as ColumnMeta, index_ColumnMetadata as ColumnMetadata, index_ConfigBuilder as ConfigBuilder, index_CorsConfig as CorsConfig, index_CorsOriginsConfig as CorsOriginsConfig, index_CrudConfig as CrudConfig, index_DEFAULT_AUTH_CONFIG as DEFAULT_AUTH_CONFIG, index_DEFAULT_CORS_CONFIG as DEFAULT_CORS_CONFIG, index_DEFAULT_CORS_ORIGINS as DEFAULT_CORS_ORIGINS, index_DEFAULT_DATABASE_CONFIG as DEFAULT_DATABASE_CONFIG, index_DEFAULT_LOGGING_CONFIG as DEFAULT_LOGGING_CONFIG, index_DEFAULT_RATE_LIMIT_CONFIG as DEFAULT_RATE_LIMIT_CONFIG, index_DEFAULT_RATE_LIMIT_TIERS as DEFAULT_RATE_LIMIT_TIERS, index_DEFAULT_SERVER_CONFIG as DEFAULT_SERVER_CONFIG, index_DatabaseConfig as DatabaseConfig, index_DbConnectionOptions as DbConnectionOptions, index_EXYCONN_CORS_CONFIG as EXYCONN_CORS_CONFIG, index_Environment as Environment, index_FilterOptions as FilterOptions, index_JWTPayload as JWTPayload, index_LogLevel as LogLevel, index_LoggerConfig as LoggerConfig, index_LoggingConfig as LoggingConfig, index_OrgRequest as OrgRequest, index_PERMISSIVE_CORS_CONFIG as PERMISSIVE_CORS_CONFIG, index_PackageCheckResult as PackageCheckResult, index_PackageJson as PackageJson, index_PackageVersion as PackageVersion, index_PaginatedRequest as PaginatedRequest, index_PaginatedResponse as PaginatedResponse, index_PaginatedResult as PaginatedResult, index_PaginationData as PaginationData, index_PaginationMeta as PaginationMeta, index_PaginationOptions as PaginationOptions, index_PaginationResult as PaginationResult, index_ParsedQuery as ParsedQuery, index_RATE_LIMIT_CONFIG as RATE_LIMIT_CONFIG, index_RateLimitConfig as RateLimitConfig, index_RateLimitResponse as RateLimitResponse, index_RateLimitTier as RateLimitTier, index_RateLimitTierConfig as RateLimitTierConfig, index_RateLimiterBuilder as RateLimiterBuilder, index_RateLimiterConfig as RateLimiterConfig, index_STRICT_CORS_CONFIG as STRICT_CORS_CONFIG, index_ServerConfig as ServerConfig, index_SortConfig as SortConfig, index_SortOrder as SortOrder, index_StatusCode as StatusCode, index_StatusMessage as StatusMessage, index_authenticateApiKey as authenticateApiKey, index_authenticateJWT as authenticateJWT, index_badRequestResponse as badRequestResponse, index_buildConfig as buildConfig, index_buildDeleteFilter as buildDeleteFilter, index_buildFilter as buildFilter, index_buildPagination as buildPagination, index_buildPaginationMeta as buildPaginationMeta, index_checkPackageServer as checkPackageServer, index_conflictResponse as conflictResponse, index_connectDB as connectDB, index_corsOptions as corsOptions, index_createApiKeyGenerator as createApiKeyGenerator, index_createApiRateLimiter as createApiRateLimiter, index_createBrandCorsOptions as createBrandCorsOptions, index_createBulkDeleteHandler as createBulkDeleteHandler, index_createConfig as createConfig, index_createCorsOptions as createCorsOptions, index_createCrudControllers as createCrudControllers, index_createDdosRateLimiter as createDdosRateLimiter, index_createLogger as createLogger, index_createMorganStream as createMorganStream, index_createMultiBrandCorsOptions as createMultiBrandCorsOptions, index_createPaginationMiddleware as createPaginationMiddleware, index_createPrefixedKeyGenerator as createPrefixedKeyGenerator, index_createRateLimiter as createRateLimiter, index_createStandardRateLimiter as createStandardRateLimiter, index_createStrictRateLimiter as createStrictRateLimiter, index_createUserKeyGenerator as createUserKeyGenerator, index_createdResponse as createdResponse, index_ddosProtectionLimiter as ddosProtectionLimiter, index_defaultKeyGenerator as defaultKeyGenerator, index_disconnectDB as disconnectDB, index_errorResponse as errorResponse, index_extractColumns as extractColumns, index_extractOrganization as extractOrganization, index_extractSchemaMeta as extractSchemaMeta, index_forbiddenResponse as forbiddenResponse, index_formatPackageCheckResult as formatPackageCheckResult, index_generateNcuCommand as generateNcuCommand, index_getConnectionStatus as getConnectionStatus, index_getDatabaseOptions as getDatabaseOptions, index_isDevelopment as isDevelopment, index_isProduction as isProduction, index_isTest as isTest, index_logger as logger, index_noContentResponse as noContentResponse, index_notFoundResponse as notFoundResponse, index_omitFields as omitFields, index_optionalAuthenticateJWT as optionalAuthenticateJWT, index_packageCheckServer as packageCheckServer, index_parseBulkDelete as parseBulkDelete, index_pickFields as pickFields, index_printPackageCheckSummary as printPackageCheckSummary, index_queryPagination as queryPagination, index_queryParser as queryParser, index_rateLimitResponse as rateLimitResponse, index_rateLimiter as rateLimiter, index_requireOrganization as requireOrganization, index_sanitizeDocument as sanitizeDocument, index_sanitizeUser as sanitizeUser, index_simpleLogger as simpleLogger, index_standardRateLimiter as standardRateLimiter, index_statusCode as statusCode, index_statusMessage as statusMessage, index_stream as stream, index_strictRateLimiter as strictRateLimiter, index_successResponse as successResponse, index_successResponseArr as successResponseArr, index_unauthorizedResponse as unauthorizedResponse, index_validationErrorResponse as validationErrorResponse };
140
+ export { index_ApiResponse as ApiResponse, index_AppConfig as AppConfig, index_AuthConfig as AuthConfig, index_AuthRequest as AuthRequest, index_BulkDeleteRequest as BulkDeleteRequest, index_ColumnMeta as ColumnMeta, index_ColumnMetadata as ColumnMetadata, index_ConfigBuilder as ConfigBuilder, index_CorsConfig as CorsConfig, index_CorsOriginsConfig as CorsOriginsConfig, index_CrudConfig as CrudConfig, index_DEFAULT_AUTH_CONFIG as DEFAULT_AUTH_CONFIG, index_DEFAULT_CORS_CONFIG as DEFAULT_CORS_CONFIG, index_DEFAULT_CORS_ORIGINS as DEFAULT_CORS_ORIGINS, index_DEFAULT_DATABASE_CONFIG as DEFAULT_DATABASE_CONFIG, index_DEFAULT_LOGGING_CONFIG as DEFAULT_LOGGING_CONFIG, index_DEFAULT_RATE_LIMIT_CONFIG as DEFAULT_RATE_LIMIT_CONFIG, index_DEFAULT_RATE_LIMIT_TIERS as DEFAULT_RATE_LIMIT_TIERS, index_DEFAULT_SERVER_CONFIG as DEFAULT_SERVER_CONFIG, index_DatabaseConfig as DatabaseConfig, index_DbConnectionOptions as DbConnectionOptions, index_EXYCONN_CORS_CONFIG as EXYCONN_CORS_CONFIG, index_Environment as Environment, index_FilterOptions as FilterOptions, index_HealthConfig as HealthConfig, index_HealthResponse as HealthResponse, index_JWTPayload as JWTPayload, index_LogLevel as LogLevel, index_LoggerConfig as LoggerConfig, index_LoggingConfig as LoggingConfig, index_OrgRequest as OrgRequest, index_PERMISSIVE_CORS_CONFIG as PERMISSIVE_CORS_CONFIG, index_PackageCheckResult as PackageCheckResult, index_PackageJson as PackageJson, index_PackageVersion as PackageVersion, index_PaginatedRequest as PaginatedRequest, index_PaginatedResponse as PaginatedResponse, index_PaginatedResult as PaginatedResult, index_PaginationData as PaginationData, index_PaginationMeta as PaginationMeta, index_PaginationOptions as PaginationOptions, index_PaginationResult as PaginationResult, index_ParsedQuery as ParsedQuery, index_RATE_LIMIT_CONFIG as RATE_LIMIT_CONFIG, index_RateLimitConfig as RateLimitConfig, index_RateLimitResponse as RateLimitResponse, index_RateLimitTier as RateLimitTier, index_RateLimitTierConfig as RateLimitTierConfig, index_RateLimiterBuilder as RateLimiterBuilder, index_RateLimiterConfig as RateLimiterConfig, index_STRICT_CORS_CONFIG as STRICT_CORS_CONFIG, index_ServerConfig as ServerConfig, index_SortConfig as SortConfig, index_SortOrder as SortOrder, index_StatusCode as StatusCode, index_StatusMessage as StatusMessage, index_authenticateApiKey as authenticateApiKey, index_authenticateJWT as authenticateJWT, index_badRequestResponse as badRequestResponse, index_buildConfig as buildConfig, index_buildDeleteFilter as buildDeleteFilter, index_buildFilter as buildFilter, index_buildPagination as buildPagination, index_buildPaginationMeta as buildPaginationMeta, index_checkPackageServer as checkPackageServer, index_conflictResponse as conflictResponse, index_connectDB as connectDB, index_corsOptions as corsOptions, index_createApiKeyGenerator as createApiKeyGenerator, index_createApiRateLimiter as createApiRateLimiter, index_createBrandCorsOptions as createBrandCorsOptions, index_createBulkDeleteHandler as createBulkDeleteHandler, index_createConfig as createConfig, index_createCorsOptions as createCorsOptions, index_createCrudControllers as createCrudControllers, index_createDdosRateLimiter as createDdosRateLimiter, index_createHealthHandler as createHealthHandler, index_createLogger as createLogger, index_createMorganStream as createMorganStream, index_createMultiBrandCorsOptions as createMultiBrandCorsOptions, index_createPaginationMiddleware as createPaginationMiddleware, index_createPrefixedKeyGenerator as createPrefixedKeyGenerator, index_createRateLimiter as createRateLimiter, index_createRootHandler as createRootHandler, index_createStandardRateLimiter as createStandardRateLimiter, index_createStrictRateLimiter as createStrictRateLimiter, index_createUserKeyGenerator as createUserKeyGenerator, index_createdResponse as createdResponse, index_ddosProtectionLimiter as ddosProtectionLimiter, index_defaultKeyGenerator as defaultKeyGenerator, index_disconnectDB as disconnectDB, index_errorResponse as errorResponse, index_extractColumns as extractColumns, index_extractOrganization as extractOrganization, index_extractSchemaMeta as extractSchemaMeta, index_forbiddenResponse as forbiddenResponse, index_formatPackageCheckResult as formatPackageCheckResult, index_generateHealthResponse as generateHealthResponse, index_generateNcuCommand as generateNcuCommand, index_getConnectionStatus as getConnectionStatus, index_getDatabaseOptions as getDatabaseOptions, index_isDevelopment as isDevelopment, index_isProduction as isProduction, index_isTest as isTest, index_logger as logger, index_noContentResponse as noContentResponse, index_notFoundResponse as notFoundResponse, index_omitFields as omitFields, index_optionalAuthenticateJWT as optionalAuthenticateJWT, index_packageCheckServer as packageCheckServer, index_parseBulkDelete as parseBulkDelete, index_pickFields as pickFields, index_printPackageCheckSummary as printPackageCheckSummary, index_queryPagination as queryPagination, index_queryParser as queryParser, index_rateLimitResponse as rateLimitResponse, index_rateLimiter as rateLimiter, index_requireOrganization as requireOrganization, index_sanitizeDocument as sanitizeDocument, index_sanitizeUser as sanitizeUser, index_simpleLogger as simpleLogger, index_standardRateLimiter as standardRateLimiter, index_statusCode as statusCode, index_statusMessage as statusMessage, index_stream as stream, index_strictRateLimiter as strictRateLimiter, index_successResponse as successResponse, index_successResponseArr as successResponseArr, index_unauthorizedResponse as unauthorizedResponse, index_validationErrorResponse as validationErrorResponse };
136
141
  }
137
142
 
138
143
  export { index as i };
@@ -3,7 +3,7 @@ import { StatusCode, StatusMessage, statusCode, statusMessage } from './server/e
3
3
  import { LoggerConfig, createLogger, createMorganStream, logger, simpleLogger, stream } from './server/logger/index.js';
4
4
  import { DbConnectionOptions, connectDB, disconnectDB, getConnectionStatus } from './server/db/index.js';
5
5
  import { AuthRequest, BulkDeleteRequest, ColumnMeta, CrudConfig, JWTPayload, OrgRequest, PaginatedRequest, PaginatedResponse, PaginatedResult, PaginationMeta, ParsedQuery, SortConfig, SortOrder, authenticateApiKey, authenticateJWT, buildDeleteFilter, createBulkDeleteHandler, createCrudControllers, createPaginationMiddleware, extractOrganization, extractSchemaMeta, optionalAuthenticateJWT, parseBulkDelete, queryPagination, queryParser, requireOrganization } from './server/middleware/index.js';
6
- import { FilterOptions, PackageCheckResult, PackageJson, PackageVersion, PaginationOptions, PaginationResult, buildFilter, buildPagination, buildPaginationMeta, checkPackageServer, formatPackageCheckResult, generateNcuCommand, omitFields, packageCheckServer, pickFields, printPackageCheckSummary, sanitizeDocument, sanitizeUser } from './server/utils/index.js';
6
+ import { FilterOptions, HealthConfig, HealthResponse, PackageCheckResult, PackageJson, PackageVersion, PaginationOptions, PaginationResult, buildFilter, buildPagination, buildPaginationMeta, checkPackageServer, createHealthHandler, createRootHandler, formatPackageCheckResult, generateHealthResponse, generateNcuCommand, omitFields, packageCheckServer, pickFields, printPackageCheckSummary, sanitizeDocument, sanitizeUser } from './server/utils/index.js';
7
7
  import { AppConfig, AuthConfig, ConfigBuilder, CorsConfig, CorsOriginsConfig, DEFAULT_AUTH_CONFIG, DEFAULT_CORS_CONFIG, DEFAULT_CORS_ORIGINS, DEFAULT_DATABASE_CONFIG, DEFAULT_LOGGING_CONFIG, DEFAULT_RATE_LIMIT_CONFIG, DEFAULT_RATE_LIMIT_TIERS, DEFAULT_SERVER_CONFIG, DatabaseConfig, EXYCONN_CORS_CONFIG, Environment, LogLevel, LoggingConfig, PERMISSIVE_CORS_CONFIG, RATE_LIMIT_CONFIG, RateLimitConfig, RateLimitResponse, RateLimitTier, RateLimitTierConfig, RateLimiterBuilder, RateLimiterConfig, STRICT_CORS_CONFIG, ServerConfig, buildConfig, corsOptions, createApiKeyGenerator, createApiRateLimiter, createBrandCorsOptions, createConfig, createCorsOptions, createDdosRateLimiter, createMultiBrandCorsOptions, createPrefixedKeyGenerator, createRateLimiter, createStandardRateLimiter, createStrictRateLimiter, createUserKeyGenerator, ddosProtectionLimiter, defaultKeyGenerator, getDatabaseOptions, isDevelopment, isProduction, isTest, rateLimiter, standardRateLimiter, strictRateLimiter } from './server/configs/index.js';
8
8
 
9
9
  declare const index_ApiResponse: typeof ApiResponse;
@@ -30,6 +30,8 @@ declare const index_DbConnectionOptions: typeof DbConnectionOptions;
30
30
  declare const index_EXYCONN_CORS_CONFIG: typeof EXYCONN_CORS_CONFIG;
31
31
  declare const index_Environment: typeof Environment;
32
32
  declare const index_FilterOptions: typeof FilterOptions;
33
+ declare const index_HealthConfig: typeof HealthConfig;
34
+ declare const index_HealthResponse: typeof HealthResponse;
33
35
  declare const index_JWTPayload: typeof JWTPayload;
34
36
  declare const index_LogLevel: typeof LogLevel;
35
37
  declare const index_LoggerConfig: typeof LoggerConfig;
@@ -80,12 +82,14 @@ declare const index_createConfig: typeof createConfig;
80
82
  declare const index_createCorsOptions: typeof createCorsOptions;
81
83
  declare const index_createCrudControllers: typeof createCrudControllers;
82
84
  declare const index_createDdosRateLimiter: typeof createDdosRateLimiter;
85
+ declare const index_createHealthHandler: typeof createHealthHandler;
83
86
  declare const index_createLogger: typeof createLogger;
84
87
  declare const index_createMorganStream: typeof createMorganStream;
85
88
  declare const index_createMultiBrandCorsOptions: typeof createMultiBrandCorsOptions;
86
89
  declare const index_createPaginationMiddleware: typeof createPaginationMiddleware;
87
90
  declare const index_createPrefixedKeyGenerator: typeof createPrefixedKeyGenerator;
88
91
  declare const index_createRateLimiter: typeof createRateLimiter;
92
+ declare const index_createRootHandler: typeof createRootHandler;
89
93
  declare const index_createStandardRateLimiter: typeof createStandardRateLimiter;
90
94
  declare const index_createStrictRateLimiter: typeof createStrictRateLimiter;
91
95
  declare const index_createUserKeyGenerator: typeof createUserKeyGenerator;
@@ -99,6 +103,7 @@ declare const index_extractOrganization: typeof extractOrganization;
99
103
  declare const index_extractSchemaMeta: typeof extractSchemaMeta;
100
104
  declare const index_forbiddenResponse: typeof forbiddenResponse;
101
105
  declare const index_formatPackageCheckResult: typeof formatPackageCheckResult;
106
+ declare const index_generateHealthResponse: typeof generateHealthResponse;
102
107
  declare const index_generateNcuCommand: typeof generateNcuCommand;
103
108
  declare const index_getConnectionStatus: typeof getConnectionStatus;
104
109
  declare const index_getDatabaseOptions: typeof getDatabaseOptions;
@@ -132,7 +137,7 @@ declare const index_successResponseArr: typeof successResponseArr;
132
137
  declare const index_unauthorizedResponse: typeof unauthorizedResponse;
133
138
  declare const index_validationErrorResponse: typeof validationErrorResponse;
134
139
  declare namespace index {
135
- export { index_ApiResponse as ApiResponse, index_AppConfig as AppConfig, index_AuthConfig as AuthConfig, index_AuthRequest as AuthRequest, index_BulkDeleteRequest as BulkDeleteRequest, index_ColumnMeta as ColumnMeta, index_ColumnMetadata as ColumnMetadata, index_ConfigBuilder as ConfigBuilder, index_CorsConfig as CorsConfig, index_CorsOriginsConfig as CorsOriginsConfig, index_CrudConfig as CrudConfig, index_DEFAULT_AUTH_CONFIG as DEFAULT_AUTH_CONFIG, index_DEFAULT_CORS_CONFIG as DEFAULT_CORS_CONFIG, index_DEFAULT_CORS_ORIGINS as DEFAULT_CORS_ORIGINS, index_DEFAULT_DATABASE_CONFIG as DEFAULT_DATABASE_CONFIG, index_DEFAULT_LOGGING_CONFIG as DEFAULT_LOGGING_CONFIG, index_DEFAULT_RATE_LIMIT_CONFIG as DEFAULT_RATE_LIMIT_CONFIG, index_DEFAULT_RATE_LIMIT_TIERS as DEFAULT_RATE_LIMIT_TIERS, index_DEFAULT_SERVER_CONFIG as DEFAULT_SERVER_CONFIG, index_DatabaseConfig as DatabaseConfig, index_DbConnectionOptions as DbConnectionOptions, index_EXYCONN_CORS_CONFIG as EXYCONN_CORS_CONFIG, index_Environment as Environment, index_FilterOptions as FilterOptions, index_JWTPayload as JWTPayload, index_LogLevel as LogLevel, index_LoggerConfig as LoggerConfig, index_LoggingConfig as LoggingConfig, index_OrgRequest as OrgRequest, index_PERMISSIVE_CORS_CONFIG as PERMISSIVE_CORS_CONFIG, index_PackageCheckResult as PackageCheckResult, index_PackageJson as PackageJson, index_PackageVersion as PackageVersion, index_PaginatedRequest as PaginatedRequest, index_PaginatedResponse as PaginatedResponse, index_PaginatedResult as PaginatedResult, index_PaginationData as PaginationData, index_PaginationMeta as PaginationMeta, index_PaginationOptions as PaginationOptions, index_PaginationResult as PaginationResult, index_ParsedQuery as ParsedQuery, index_RATE_LIMIT_CONFIG as RATE_LIMIT_CONFIG, index_RateLimitConfig as RateLimitConfig, index_RateLimitResponse as RateLimitResponse, index_RateLimitTier as RateLimitTier, index_RateLimitTierConfig as RateLimitTierConfig, index_RateLimiterBuilder as RateLimiterBuilder, index_RateLimiterConfig as RateLimiterConfig, index_STRICT_CORS_CONFIG as STRICT_CORS_CONFIG, index_ServerConfig as ServerConfig, index_SortConfig as SortConfig, index_SortOrder as SortOrder, index_StatusCode as StatusCode, index_StatusMessage as StatusMessage, index_authenticateApiKey as authenticateApiKey, index_authenticateJWT as authenticateJWT, index_badRequestResponse as badRequestResponse, index_buildConfig as buildConfig, index_buildDeleteFilter as buildDeleteFilter, index_buildFilter as buildFilter, index_buildPagination as buildPagination, index_buildPaginationMeta as buildPaginationMeta, index_checkPackageServer as checkPackageServer, index_conflictResponse as conflictResponse, index_connectDB as connectDB, index_corsOptions as corsOptions, index_createApiKeyGenerator as createApiKeyGenerator, index_createApiRateLimiter as createApiRateLimiter, index_createBrandCorsOptions as createBrandCorsOptions, index_createBulkDeleteHandler as createBulkDeleteHandler, index_createConfig as createConfig, index_createCorsOptions as createCorsOptions, index_createCrudControllers as createCrudControllers, index_createDdosRateLimiter as createDdosRateLimiter, index_createLogger as createLogger, index_createMorganStream as createMorganStream, index_createMultiBrandCorsOptions as createMultiBrandCorsOptions, index_createPaginationMiddleware as createPaginationMiddleware, index_createPrefixedKeyGenerator as createPrefixedKeyGenerator, index_createRateLimiter as createRateLimiter, index_createStandardRateLimiter as createStandardRateLimiter, index_createStrictRateLimiter as createStrictRateLimiter, index_createUserKeyGenerator as createUserKeyGenerator, index_createdResponse as createdResponse, index_ddosProtectionLimiter as ddosProtectionLimiter, index_defaultKeyGenerator as defaultKeyGenerator, index_disconnectDB as disconnectDB, index_errorResponse as errorResponse, index_extractColumns as extractColumns, index_extractOrganization as extractOrganization, index_extractSchemaMeta as extractSchemaMeta, index_forbiddenResponse as forbiddenResponse, index_formatPackageCheckResult as formatPackageCheckResult, index_generateNcuCommand as generateNcuCommand, index_getConnectionStatus as getConnectionStatus, index_getDatabaseOptions as getDatabaseOptions, index_isDevelopment as isDevelopment, index_isProduction as isProduction, index_isTest as isTest, index_logger as logger, index_noContentResponse as noContentResponse, index_notFoundResponse as notFoundResponse, index_omitFields as omitFields, index_optionalAuthenticateJWT as optionalAuthenticateJWT, index_packageCheckServer as packageCheckServer, index_parseBulkDelete as parseBulkDelete, index_pickFields as pickFields, index_printPackageCheckSummary as printPackageCheckSummary, index_queryPagination as queryPagination, index_queryParser as queryParser, index_rateLimitResponse as rateLimitResponse, index_rateLimiter as rateLimiter, index_requireOrganization as requireOrganization, index_sanitizeDocument as sanitizeDocument, index_sanitizeUser as sanitizeUser, index_simpleLogger as simpleLogger, index_standardRateLimiter as standardRateLimiter, index_statusCode as statusCode, index_statusMessage as statusMessage, index_stream as stream, index_strictRateLimiter as strictRateLimiter, index_successResponse as successResponse, index_successResponseArr as successResponseArr, index_unauthorizedResponse as unauthorizedResponse, index_validationErrorResponse as validationErrorResponse };
140
+ export { index_ApiResponse as ApiResponse, index_AppConfig as AppConfig, index_AuthConfig as AuthConfig, index_AuthRequest as AuthRequest, index_BulkDeleteRequest as BulkDeleteRequest, index_ColumnMeta as ColumnMeta, index_ColumnMetadata as ColumnMetadata, index_ConfigBuilder as ConfigBuilder, index_CorsConfig as CorsConfig, index_CorsOriginsConfig as CorsOriginsConfig, index_CrudConfig as CrudConfig, index_DEFAULT_AUTH_CONFIG as DEFAULT_AUTH_CONFIG, index_DEFAULT_CORS_CONFIG as DEFAULT_CORS_CONFIG, index_DEFAULT_CORS_ORIGINS as DEFAULT_CORS_ORIGINS, index_DEFAULT_DATABASE_CONFIG as DEFAULT_DATABASE_CONFIG, index_DEFAULT_LOGGING_CONFIG as DEFAULT_LOGGING_CONFIG, index_DEFAULT_RATE_LIMIT_CONFIG as DEFAULT_RATE_LIMIT_CONFIG, index_DEFAULT_RATE_LIMIT_TIERS as DEFAULT_RATE_LIMIT_TIERS, index_DEFAULT_SERVER_CONFIG as DEFAULT_SERVER_CONFIG, index_DatabaseConfig as DatabaseConfig, index_DbConnectionOptions as DbConnectionOptions, index_EXYCONN_CORS_CONFIG as EXYCONN_CORS_CONFIG, index_Environment as Environment, index_FilterOptions as FilterOptions, index_HealthConfig as HealthConfig, index_HealthResponse as HealthResponse, index_JWTPayload as JWTPayload, index_LogLevel as LogLevel, index_LoggerConfig as LoggerConfig, index_LoggingConfig as LoggingConfig, index_OrgRequest as OrgRequest, index_PERMISSIVE_CORS_CONFIG as PERMISSIVE_CORS_CONFIG, index_PackageCheckResult as PackageCheckResult, index_PackageJson as PackageJson, index_PackageVersion as PackageVersion, index_PaginatedRequest as PaginatedRequest, index_PaginatedResponse as PaginatedResponse, index_PaginatedResult as PaginatedResult, index_PaginationData as PaginationData, index_PaginationMeta as PaginationMeta, index_PaginationOptions as PaginationOptions, index_PaginationResult as PaginationResult, index_ParsedQuery as ParsedQuery, index_RATE_LIMIT_CONFIG as RATE_LIMIT_CONFIG, index_RateLimitConfig as RateLimitConfig, index_RateLimitResponse as RateLimitResponse, index_RateLimitTier as RateLimitTier, index_RateLimitTierConfig as RateLimitTierConfig, index_RateLimiterBuilder as RateLimiterBuilder, index_RateLimiterConfig as RateLimiterConfig, index_STRICT_CORS_CONFIG as STRICT_CORS_CONFIG, index_ServerConfig as ServerConfig, index_SortConfig as SortConfig, index_SortOrder as SortOrder, index_StatusCode as StatusCode, index_StatusMessage as StatusMessage, index_authenticateApiKey as authenticateApiKey, index_authenticateJWT as authenticateJWT, index_badRequestResponse as badRequestResponse, index_buildConfig as buildConfig, index_buildDeleteFilter as buildDeleteFilter, index_buildFilter as buildFilter, index_buildPagination as buildPagination, index_buildPaginationMeta as buildPaginationMeta, index_checkPackageServer as checkPackageServer, index_conflictResponse as conflictResponse, index_connectDB as connectDB, index_corsOptions as corsOptions, index_createApiKeyGenerator as createApiKeyGenerator, index_createApiRateLimiter as createApiRateLimiter, index_createBrandCorsOptions as createBrandCorsOptions, index_createBulkDeleteHandler as createBulkDeleteHandler, index_createConfig as createConfig, index_createCorsOptions as createCorsOptions, index_createCrudControllers as createCrudControllers, index_createDdosRateLimiter as createDdosRateLimiter, index_createHealthHandler as createHealthHandler, index_createLogger as createLogger, index_createMorganStream as createMorganStream, index_createMultiBrandCorsOptions as createMultiBrandCorsOptions, index_createPaginationMiddleware as createPaginationMiddleware, index_createPrefixedKeyGenerator as createPrefixedKeyGenerator, index_createRateLimiter as createRateLimiter, index_createRootHandler as createRootHandler, index_createStandardRateLimiter as createStandardRateLimiter, index_createStrictRateLimiter as createStrictRateLimiter, index_createUserKeyGenerator as createUserKeyGenerator, index_createdResponse as createdResponse, index_ddosProtectionLimiter as ddosProtectionLimiter, index_defaultKeyGenerator as defaultKeyGenerator, index_disconnectDB as disconnectDB, index_errorResponse as errorResponse, index_extractColumns as extractColumns, index_extractOrganization as extractOrganization, index_extractSchemaMeta as extractSchemaMeta, index_forbiddenResponse as forbiddenResponse, index_formatPackageCheckResult as formatPackageCheckResult, index_generateHealthResponse as generateHealthResponse, index_generateNcuCommand as generateNcuCommand, index_getConnectionStatus as getConnectionStatus, index_getDatabaseOptions as getDatabaseOptions, index_isDevelopment as isDevelopment, index_isProduction as isProduction, index_isTest as isTest, index_logger as logger, index_noContentResponse as noContentResponse, index_notFoundResponse as notFoundResponse, index_omitFields as omitFields, index_optionalAuthenticateJWT as optionalAuthenticateJWT, index_packageCheckServer as packageCheckServer, index_parseBulkDelete as parseBulkDelete, index_pickFields as pickFields, index_printPackageCheckSummary as printPackageCheckSummary, index_queryPagination as queryPagination, index_queryParser as queryParser, index_rateLimitResponse as rateLimitResponse, index_rateLimiter as rateLimiter, index_requireOrganization as requireOrganization, index_sanitizeDocument as sanitizeDocument, index_sanitizeUser as sanitizeUser, index_simpleLogger as simpleLogger, index_standardRateLimiter as standardRateLimiter, index_statusCode as statusCode, index_statusMessage as statusMessage, index_stream as stream, index_strictRateLimiter as strictRateLimiter, index_successResponse as successResponse, index_successResponseArr as successResponseArr, index_unauthorizedResponse as unauthorizedResponse, index_validationErrorResponse as validationErrorResponse };
136
141
  }
137
142
 
138
143
  export { index as i };
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- export { i as server } from './index-Ckhm_HaX.mjs';
1
+ export { i as server } from './index-B8O4iu6q.mjs';
2
2
  export { i as client } from './index-guYdqefq.mjs';
3
3
  export { i as shared } from './index-NS8dS0p9.mjs';
4
4
  export { i as data } from './index-jBi3V6e5.mjs';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { i as server } from './index-br6POSyA.js';
1
+ export { i as server } from './index-MpV0UNTq.js';
2
2
  export { i as client } from './index-CdbQ8YPt.js';
3
3
  export { i as shared } from './index-DKn4raO7.js';
4
4
  export { i as data } from './index-Nqm5_lwT.js';
package/dist/index.js CHANGED
@@ -2,10 +2,11 @@
2
2
 
3
3
  var winston = require('winston');
4
4
  var DailyRotateFile = require('winston-daily-rotate-file');
5
- var path = require('path');
5
+ var path2 = require('path');
6
6
  var mongoose = require('mongoose');
7
7
  var jwt = require('jsonwebtoken');
8
8
  var fs = require('fs');
9
+ var os = require('os');
9
10
  var rateLimit = require('express-rate-limit');
10
11
  var axios = require('axios');
11
12
  var react = require('react');
@@ -37,9 +38,11 @@ function _interopNamespace(e) {
37
38
 
38
39
  var winston__default = /*#__PURE__*/_interopDefault(winston);
39
40
  var DailyRotateFile__default = /*#__PURE__*/_interopDefault(DailyRotateFile);
40
- var path__default = /*#__PURE__*/_interopDefault(path);
41
+ var path2__default = /*#__PURE__*/_interopDefault(path2);
41
42
  var mongoose__default = /*#__PURE__*/_interopDefault(mongoose);
42
43
  var jwt__default = /*#__PURE__*/_interopDefault(jwt);
44
+ var fs__default = /*#__PURE__*/_interopDefault(fs);
45
+ var os__default = /*#__PURE__*/_interopDefault(os);
43
46
  var rateLimit__default = /*#__PURE__*/_interopDefault(rateLimit);
44
47
  var axios__default = /*#__PURE__*/_interopDefault(axios);
45
48
  var Yup__namespace = /*#__PURE__*/_interopNamespace(Yup);
@@ -89,12 +92,14 @@ __export(server_exports, {
89
92
  createCorsOptions: () => createCorsOptions,
90
93
  createCrudControllers: () => createCrudControllers,
91
94
  createDdosRateLimiter: () => createDdosRateLimiter,
95
+ createHealthHandler: () => createHealthHandler,
92
96
  createLogger: () => createLogger,
93
97
  createMorganStream: () => createMorganStream,
94
98
  createMultiBrandCorsOptions: () => createMultiBrandCorsOptions,
95
99
  createPaginationMiddleware: () => createPaginationMiddleware,
96
100
  createPrefixedKeyGenerator: () => createPrefixedKeyGenerator,
97
101
  createRateLimiter: () => createRateLimiter,
102
+ createRootHandler: () => createRootHandler,
98
103
  createStandardRateLimiter: () => createStandardRateLimiter,
99
104
  createStrictRateLimiter: () => createStrictRateLimiter,
100
105
  createUserKeyGenerator: () => createUserKeyGenerator,
@@ -108,6 +113,7 @@ __export(server_exports, {
108
113
  extractSchemaMeta: () => extractSchemaMeta,
109
114
  forbiddenResponse: () => forbiddenResponse,
110
115
  formatPackageCheckResult: () => formatPackageCheckResult,
116
+ generateHealthResponse: () => generateHealthResponse,
111
117
  generateNcuCommand: () => generateNcuCommand,
112
118
  getConnectionStatus: () => getConnectionStatus,
113
119
  getDatabaseOptions: () => getDatabaseOptions,
@@ -352,7 +358,7 @@ var createLogger = (config = {}) => {
352
358
  }),
353
359
  // Combined logs (all levels)
354
360
  new DailyRotateFile__default.default({
355
- filename: path__default.default.join(finalConfig.logsDir, "combined-%DATE%.log"),
361
+ filename: path2__default.default.join(finalConfig.logsDir, "combined-%DATE%.log"),
356
362
  datePattern: "YYYY-MM-DD",
357
363
  maxSize: finalConfig.maxSize,
358
364
  maxFiles: finalConfig.maxFiles,
@@ -360,7 +366,7 @@ var createLogger = (config = {}) => {
360
366
  }),
361
367
  // Error logs only
362
368
  new DailyRotateFile__default.default({
363
- filename: path__default.default.join(finalConfig.logsDir, "error-%DATE%.log"),
369
+ filename: path2__default.default.join(finalConfig.logsDir, "error-%DATE%.log"),
364
370
  datePattern: "YYYY-MM-DD",
365
371
  level: "error",
366
372
  maxSize: finalConfig.maxSize,
@@ -1315,7 +1321,7 @@ async function loadPackageJson(source) {
1315
1321
  }
1316
1322
  return response.json();
1317
1323
  }
1318
- const filePath = path.resolve(source);
1324
+ const filePath = path2.resolve(source);
1319
1325
  if (!fs.existsSync(filePath)) {
1320
1326
  throw new Error(`File not found: ${filePath}`);
1321
1327
  }
@@ -1469,6 +1475,150 @@ var packageCheckServer = {
1469
1475
  generateNcuCommand,
1470
1476
  print: printPackageCheckSummary
1471
1477
  };
1478
+ var serverStartTime = Date.now();
1479
+ function getTimezoneOffset() {
1480
+ const offset = (/* @__PURE__ */ new Date()).getTimezoneOffset();
1481
+ const hours = Math.floor(Math.abs(offset) / 60);
1482
+ const minutes = Math.abs(offset) % 60;
1483
+ const sign = offset <= 0 ? "+" : "-";
1484
+ return `${sign}${hours.toString().padStart(2, "0")}:${minutes.toString().padStart(2, "0")}`;
1485
+ }
1486
+ function getTimezoneName() {
1487
+ try {
1488
+ return Intl.DateTimeFormat().resolvedOptions().timeZone;
1489
+ } catch {
1490
+ return "UTC";
1491
+ }
1492
+ }
1493
+ function getPackageInfo(criticalPackages = []) {
1494
+ try {
1495
+ const possiblePaths = [
1496
+ path2__default.default.join(process.cwd(), "package.json"),
1497
+ path2__default.default.join(__dirname, "..", "..", "..", "..", "package.json"),
1498
+ path2__default.default.join(__dirname, "..", "..", "package.json")
1499
+ ];
1500
+ for (const pkgPath of possiblePaths) {
1501
+ if (fs__default.default.existsSync(pkgPath)) {
1502
+ const pkg = JSON.parse(fs__default.default.readFileSync(pkgPath, "utf-8"));
1503
+ const deps = pkg.dependencies || {};
1504
+ const devDeps = pkg.devDependencies || {};
1505
+ const total = Object.keys(deps).length + Object.keys(devDeps).length;
1506
+ const critical = {};
1507
+ for (const pkgName of criticalPackages) {
1508
+ if (deps[pkgName]) {
1509
+ critical[pkgName] = deps[pkgName].replace("^", "").replace("~", "");
1510
+ }
1511
+ }
1512
+ return { total, critical };
1513
+ }
1514
+ }
1515
+ } catch {
1516
+ }
1517
+ return { total: 0, critical: {} };
1518
+ }
1519
+ async function generateHealthResponse(config) {
1520
+ const startTime = Date.now();
1521
+ const now = /* @__PURE__ */ new Date();
1522
+ let dependencies = {};
1523
+ if (config.checkDependencies) {
1524
+ try {
1525
+ dependencies = await config.checkDependencies();
1526
+ } catch {
1527
+ dependencies = { error: "DOWN" };
1528
+ }
1529
+ }
1530
+ const hasDownDep = Object.values(dependencies).includes("DOWN");
1531
+ const status = hasDownDep ? "DEGRADED" : "UP";
1532
+ const defaultCriticalPackages = ["express", "mongoose", "cors", "dotenv"];
1533
+ const packageInfo = getPackageInfo(config.criticalPackages || defaultCriticalPackages);
1534
+ const totalMem = os__default.default.totalmem();
1535
+ const freeMem = os__default.default.freemem();
1536
+ const usedMem = totalMem - freeMem;
1537
+ const isProduction2 = process.env.NODE_ENV === "production";
1538
+ const serverUrl = isProduction2 ? `https://${config.domain}` : `http://localhost:${config.port}`;
1539
+ const response = {
1540
+ status,
1541
+ app: config.name,
1542
+ env: process.env.NODE_ENV || "development",
1543
+ version: config.version,
1544
+ urls: {
1545
+ ...config.uiUrl && { ui: config.uiUrl },
1546
+ server: config.serverUrl || serverUrl,
1547
+ health: `${config.serverUrl || serverUrl}/health`
1548
+ },
1549
+ time: {
1550
+ serverTime: now.toISOString(),
1551
+ timezone: getTimezoneName(),
1552
+ offset: getTimezoneOffset(),
1553
+ epoch: Math.floor(now.getTime() / 1e3)
1554
+ },
1555
+ uptimeSec: Math.floor((Date.now() - serverStartTime) / 1e3),
1556
+ node: {
1557
+ version: process.version,
1558
+ platform: os__default.default.platform(),
1559
+ arch: os__default.default.arch()
1560
+ },
1561
+ system: {
1562
+ hostname: os__default.default.hostname(),
1563
+ memoryUsedMB: Math.round(usedMem / 1024 / 1024),
1564
+ memoryTotalMB: Math.round(totalMem / 1024 / 1024),
1565
+ memoryFreePercent: Math.round(freeMem / totalMem * 100),
1566
+ cpuLoad: os__default.default.loadavg().map((l) => Math.round(l * 100) / 100),
1567
+ cpuCount: os__default.default.cpus().length
1568
+ },
1569
+ packages: {
1570
+ appVersion: config.version,
1571
+ totalDependencies: packageInfo.total,
1572
+ critical: packageInfo.critical
1573
+ },
1574
+ dependencies,
1575
+ ...config.infra && { infra: config.infra },
1576
+ responseTimeMs: Date.now() - startTime
1577
+ };
1578
+ return response;
1579
+ }
1580
+ function createHealthHandler(config) {
1581
+ return async (_req, res) => {
1582
+ try {
1583
+ const health = await generateHealthResponse(config);
1584
+ const statusCode2 = health.status === "UP" ? 200 : health.status === "DEGRADED" ? 200 : 503;
1585
+ res.status(statusCode2).json(health);
1586
+ } catch (error) {
1587
+ res.status(503).json({
1588
+ status: "DOWN",
1589
+ app: config.name,
1590
+ env: process.env.NODE_ENV || "development",
1591
+ version: config.version,
1592
+ error: error instanceof Error ? error.message : "Unknown error",
1593
+ time: {
1594
+ serverTime: (/* @__PURE__ */ new Date()).toISOString(),
1595
+ timezone: getTimezoneName(),
1596
+ offset: getTimezoneOffset(),
1597
+ epoch: Math.floor(Date.now() / 1e3)
1598
+ }
1599
+ });
1600
+ }
1601
+ };
1602
+ }
1603
+ function createRootHandler(config) {
1604
+ return async (_req, res) => {
1605
+ try {
1606
+ const health = await generateHealthResponse(config);
1607
+ res.json({
1608
+ message: `Welcome to ${config.name}`,
1609
+ description: config.description || `${config.name} API Server`,
1610
+ ...config.endpoints && { endpoints: config.endpoints },
1611
+ ...health
1612
+ });
1613
+ } catch (error) {
1614
+ res.status(503).json({
1615
+ status: "DOWN",
1616
+ app: config.name,
1617
+ error: error instanceof Error ? error.message : "Unknown error"
1618
+ });
1619
+ }
1620
+ };
1621
+ }
1472
1622
 
1473
1623
  // src/server/configs/cors.config.ts
1474
1624
  var DEFAULT_CORS_CONFIG = {
@@ -2527,9 +2677,9 @@ var parsePaginatedResponse = (response) => {
2527
2677
  return { items: [], total: 0, page: 1, limit: 10 };
2528
2678
  }
2529
2679
  };
2530
- var extractNestedData = (response, path2, fallback = null) => {
2680
+ var extractNestedData = (response, path3, fallback = null) => {
2531
2681
  try {
2532
- const keys = path2.split(".");
2682
+ const keys = path3.split(".");
2533
2683
  let current = response;
2534
2684
  for (const key of keys) {
2535
2685
  if (current && typeof current === "object" && key in current) {
@@ -6663,11 +6813,11 @@ function getContrastColor(hex) {
6663
6813
  }
6664
6814
  function flattenToCssVars(obj, prefix = "--ec") {
6665
6815
  const result = {};
6666
- function flatten(current, path2 = []) {
6816
+ function flatten(current, path3 = []) {
6667
6817
  for (const key in current) {
6668
6818
  if (Object.prototype.hasOwnProperty.call(current, key)) {
6669
6819
  const value = current[key];
6670
- const newPath = [...path2, key];
6820
+ const newPath = [...path3, key];
6671
6821
  const varName = `${prefix}-${newPath.join("-")}`;
6672
6822
  if (value && typeof value === "object" && !Array.isArray(value)) {
6673
6823
  flatten(value, newPath);
@@ -6925,8 +7075,8 @@ function ThemeProvider({
6925
7075
  );
6926
7076
  return /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value: contextValue, children });
6927
7077
  }
6928
- function cssVar(path2, prefix = "--ec") {
6929
- return `var(${prefix}-${path2.replace(/\./g, "-")})`;
7078
+ function cssVar(path3, prefix = "--ec") {
7079
+ return `var(${prefix}-${path3.replace(/\./g, "-")})`;
6930
7080
  }
6931
7081
  function useThemeValue(selector) {
6932
7082
  const { theme } = useTheme();