xypriss 3.2.1 → 3.2.3
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/README.md +98 -447
- package/dist/cjs/src/FiUp.js +85 -0
- package/dist/cjs/src/FiUp.js.map +1 -0
- package/dist/cjs/src/file-upload.js +14 -87
- package/dist/cjs/src/file-upload.js.map +1 -1
- package/dist/cjs/src/index.js +8 -5
- package/dist/cjs/src/index.js.map +1 -1
- package/dist/cjs/src/middleware/built-in/BuiltInMiddleware.js +51 -8
- package/dist/cjs/src/middleware/built-in/BuiltInMiddleware.js.map +1 -1
- package/dist/cjs/src/server/FastServer.js +9 -5
- package/dist/cjs/src/server/FastServer.js.map +1 -1
- package/dist/cjs/src/server/components/fastapi/FileUploadManager.js +31 -19
- package/dist/cjs/src/server/components/fastapi/FileUploadManager.js.map +1 -1
- package/dist/cjs/src/server/const/default.js +10 -6
- package/dist/cjs/src/server/const/default.js.map +1 -1
- package/dist/cjs/src/server/core/HttpServer.js +16 -7
- package/dist/cjs/src/server/core/HttpServer.js.map +1 -1
- package/dist/cjs/src/server/core/XyprissApp.js +2 -1
- package/dist/cjs/src/server/core/XyprissApp.js.map +1 -1
- package/dist/esm/src/FiUp.js +79 -0
- package/dist/esm/src/FiUp.js.map +1 -0
- package/dist/esm/src/file-upload.js +9 -83
- package/dist/esm/src/file-upload.js.map +1 -1
- package/dist/esm/src/index.js +3 -1
- package/dist/esm/src/index.js.map +1 -1
- package/dist/esm/src/middleware/built-in/BuiltInMiddleware.js +51 -8
- package/dist/esm/src/middleware/built-in/BuiltInMiddleware.js.map +1 -1
- package/dist/esm/src/server/FastServer.js +9 -5
- package/dist/esm/src/server/FastServer.js.map +1 -1
- package/dist/esm/src/server/components/fastapi/FileUploadManager.js +31 -19
- package/dist/esm/src/server/components/fastapi/FileUploadManager.js.map +1 -1
- package/dist/esm/src/server/const/default.js +10 -6
- package/dist/esm/src/server/const/default.js.map +1 -1
- package/dist/esm/src/server/core/HttpServer.js +16 -7
- package/dist/esm/src/server/core/HttpServer.js.map +1 -1
- package/dist/esm/src/server/core/XyprissApp.js +2 -1
- package/dist/esm/src/server/core/XyprissApp.js.map +1 -1
- package/dist/index.d.ts +154 -99
- package/package.json +4 -4
- package/dist/cjs/mods/security/src/core/crypt.js +0 -56
- package/dist/cjs/mods/security/src/core/crypt.js.map +0 -1
- package/dist/cjs/src/middleware/built-in/index.js +0 -325
- package/dist/cjs/src/middleware/built-in/index.js.map +0 -1
- package/dist/cjs/src/middleware/built-in/sqlInjection.js +0 -335
- package/dist/cjs/src/middleware/built-in/sqlInjection.js.map +0 -1
- package/dist/cjs/src/server/conf/rateLimitConfig.js +0 -35
- package/dist/cjs/src/server/conf/rateLimitConfig.js.map +0 -1
- package/dist/cjs/src/server/utils/wildcardMatcher.js +0 -92
- package/dist/cjs/src/server/utils/wildcardMatcher.js.map +0 -1
- package/dist/esm/mods/security/src/core/crypt.js +0 -54
- package/dist/esm/mods/security/src/core/crypt.js.map +0 -1
- package/dist/esm/src/middleware/built-in/index.js +0 -323
- package/dist/esm/src/middleware/built-in/index.js.map +0 -1
- package/dist/esm/src/middleware/built-in/sqlInjection.js +0 -333
- package/dist/esm/src/middleware/built-in/sqlInjection.js.map +0 -1
- package/dist/esm/src/server/conf/rateLimitConfig.js +0 -33
- package/dist/esm/src/server/conf/rateLimitConfig.js.map +0 -1
- package/dist/esm/src/server/utils/wildcardMatcher.js +0 -88
- package/dist/esm/src/server/utils/wildcardMatcher.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -5583,79 +5583,6 @@ interface XyPrissMiddlewareAPI {
|
|
|
5583
5583
|
getConfig(): any;
|
|
5584
5584
|
}
|
|
5585
5585
|
|
|
5586
|
-
/**
|
|
5587
|
-
* File Upload Manager for XyPriss Server
|
|
5588
|
-
* Handles multer configuration and file upload middleware setup
|
|
5589
|
-
*/
|
|
5590
|
-
|
|
5591
|
-
interface FileUploadConfig {
|
|
5592
|
-
/** Enable file upload handling */
|
|
5593
|
-
enabled?: boolean;
|
|
5594
|
-
/** Maximum file size in bytes */
|
|
5595
|
-
maxFileSize?: number;
|
|
5596
|
-
/** Maximum number of files per request */
|
|
5597
|
-
maxFiles?: number;
|
|
5598
|
-
/** Allowed MIME types */
|
|
5599
|
-
allowedMimeTypes?: string[];
|
|
5600
|
-
/** Allowed file extensions */
|
|
5601
|
-
allowedExtensions?: string[];
|
|
5602
|
-
/** Upload destination directory */
|
|
5603
|
-
destination?: string;
|
|
5604
|
-
/** Custom filename function */
|
|
5605
|
-
filename?: (req: any, file: any, callback: (error: Error | null, filename: string) => void) => void;
|
|
5606
|
-
/** Detailed limits configuration */
|
|
5607
|
-
limits?: {
|
|
5608
|
-
/** Max field name size in bytes */
|
|
5609
|
-
fieldNameSize?: number;
|
|
5610
|
-
/** Max field value size in bytes */
|
|
5611
|
-
fieldSize?: number;
|
|
5612
|
-
/** Max number of non-file fields */
|
|
5613
|
-
fields?: number;
|
|
5614
|
-
/** Max file size in bytes */
|
|
5615
|
-
fileSize?: number;
|
|
5616
|
-
/** Max number of file fields */
|
|
5617
|
-
files?: number;
|
|
5618
|
-
/** Max number of header key=>value pairs */
|
|
5619
|
-
headerPairs?: number;
|
|
5620
|
-
};
|
|
5621
|
-
/** Preserve full paths instead of just filenames */
|
|
5622
|
-
preservePath?: boolean;
|
|
5623
|
-
/** Custom file filter function */
|
|
5624
|
-
fileFilter?: (req: any, file: any, callback: (error: Error | null, acceptFile: boolean) => void) => void;
|
|
5625
|
-
/** Storage type */
|
|
5626
|
-
storage?: 'disk' | 'memory' | 'custom';
|
|
5627
|
-
/** Create parent directories if they don't exist */
|
|
5628
|
-
createParentPath?: boolean;
|
|
5629
|
-
/** Abort request on limit reached */
|
|
5630
|
-
abortOnLimit?: boolean;
|
|
5631
|
-
/** Response message when limit is reached */
|
|
5632
|
-
responseOnLimit?: string;
|
|
5633
|
-
/** Use temporary files for large uploads */
|
|
5634
|
-
useTempFiles?: boolean;
|
|
5635
|
-
/** Temporary file directory */
|
|
5636
|
-
tempFileDir?: string;
|
|
5637
|
-
/** Parse nested objects in multipart data */
|
|
5638
|
-
parseNested?: boolean;
|
|
5639
|
-
/** Enable debug logging */
|
|
5640
|
-
debug?: boolean;
|
|
5641
|
-
/** Custom multer options */
|
|
5642
|
-
multerOptions?: {
|
|
5643
|
-
dest?: string;
|
|
5644
|
-
storage?: any;
|
|
5645
|
-
limits?: {
|
|
5646
|
-
fieldNameSize?: number;
|
|
5647
|
-
fieldSize?: number;
|
|
5648
|
-
fields?: number;
|
|
5649
|
-
fileSize?: number;
|
|
5650
|
-
files?: number;
|
|
5651
|
-
headerPairs?: number;
|
|
5652
|
-
};
|
|
5653
|
-
preservePath?: boolean;
|
|
5654
|
-
fileFilter?: (req: any, file: any, callback: (error: Error | null, acceptFile: boolean) => void) => void;
|
|
5655
|
-
[key: string]: any;
|
|
5656
|
-
};
|
|
5657
|
-
}
|
|
5658
|
-
|
|
5659
5586
|
/**
|
|
5660
5587
|
* XyPrissJS Express Types - Main Export File
|
|
5661
5588
|
*
|
|
@@ -6798,6 +6725,12 @@ interface UltraFastApp {
|
|
|
6798
6725
|
* encryption, compression, and intelligent strategies.
|
|
6799
6726
|
*/
|
|
6800
6727
|
cache?: SecureCacheAdapter;
|
|
6728
|
+
/**
|
|
6729
|
+
* Server configuration options.
|
|
6730
|
+
*
|
|
6731
|
+
* Provides access to the configuration options passed to createServer.
|
|
6732
|
+
*/
|
|
6733
|
+
configs?: ServerOptions;
|
|
6801
6734
|
/**
|
|
6802
6735
|
* Invalidate cache entries by pattern.
|
|
6803
6736
|
*
|
|
@@ -7434,6 +7367,152 @@ declare class Logger {
|
|
|
7434
7367
|
child(component: LogComponent, config?: Partial<ServerOptions["logging"]>): Logger;
|
|
7435
7368
|
}
|
|
7436
7369
|
|
|
7370
|
+
interface FileUploadConfig {
|
|
7371
|
+
/** Enable file upload handling */
|
|
7372
|
+
enabled?: boolean;
|
|
7373
|
+
/** Maximum file size in bytes */
|
|
7374
|
+
maxFileSize?: number;
|
|
7375
|
+
/** Maximum number of files per request */
|
|
7376
|
+
maxFiles?: number;
|
|
7377
|
+
/** Allowed MIME types */
|
|
7378
|
+
allowedMimeTypes?: string[];
|
|
7379
|
+
/** Allowed file extensions */
|
|
7380
|
+
allowedExtensions?: string[];
|
|
7381
|
+
/** Upload destination directory */
|
|
7382
|
+
destination?: string;
|
|
7383
|
+
/** Custom filename function */
|
|
7384
|
+
filename?: (req: any, file: any, callback: (error: Error | null, filename: string) => void) => void;
|
|
7385
|
+
/** Detailed limits configuration */
|
|
7386
|
+
limits?: {
|
|
7387
|
+
/** Max field name size in bytes */
|
|
7388
|
+
fieldNameSize?: number;
|
|
7389
|
+
/** Max field value size in bytes */
|
|
7390
|
+
fieldSize?: number;
|
|
7391
|
+
/** Max number of non-file fields */
|
|
7392
|
+
fields?: number;
|
|
7393
|
+
/** Max file size in bytes */
|
|
7394
|
+
fileSize?: number;
|
|
7395
|
+
/** Max number of file fields */
|
|
7396
|
+
files?: number;
|
|
7397
|
+
/** Max number of header key=>value pairs */
|
|
7398
|
+
headerPairs?: number;
|
|
7399
|
+
};
|
|
7400
|
+
/** Preserve full paths instead of just filenames */
|
|
7401
|
+
preservePath?: boolean;
|
|
7402
|
+
/** Custom file filter function */
|
|
7403
|
+
fileFilter?: (req: any, file: any, callback: (error: Error | null, acceptFile: boolean) => void) => void;
|
|
7404
|
+
/** Storage type */
|
|
7405
|
+
storage?: 'disk' | 'memory' | 'custom';
|
|
7406
|
+
/** Create parent directories if they don't exist */
|
|
7407
|
+
createParentPath?: boolean;
|
|
7408
|
+
/** Abort request on limit reached */
|
|
7409
|
+
abortOnLimit?: boolean;
|
|
7410
|
+
/** Response message when limit is reached */
|
|
7411
|
+
responseOnLimit?: string;
|
|
7412
|
+
/** Use temporary files for large uploads */
|
|
7413
|
+
useTempFiles?: boolean;
|
|
7414
|
+
/** Temporary file directory */
|
|
7415
|
+
tempFileDir?: string;
|
|
7416
|
+
/** Parse nested objects in multipart data */
|
|
7417
|
+
parseNested?: boolean;
|
|
7418
|
+
/** Enable debug logging */
|
|
7419
|
+
debug?: boolean;
|
|
7420
|
+
/** Custom multer options */
|
|
7421
|
+
multerOptions?: {
|
|
7422
|
+
dest?: string;
|
|
7423
|
+
storage?: any;
|
|
7424
|
+
limits?: {
|
|
7425
|
+
fieldNameSize?: number;
|
|
7426
|
+
fieldSize?: number;
|
|
7427
|
+
fields?: number;
|
|
7428
|
+
fileSize?: number;
|
|
7429
|
+
files?: number;
|
|
7430
|
+
headerPairs?: number;
|
|
7431
|
+
};
|
|
7432
|
+
preservePath?: boolean;
|
|
7433
|
+
fileFilter?: (req: any, file: any, callback: (error: Error | null, acceptFile: boolean) => void) => void;
|
|
7434
|
+
[key: string]: any;
|
|
7435
|
+
};
|
|
7436
|
+
}
|
|
7437
|
+
|
|
7438
|
+
/**
|
|
7439
|
+
* File Upload Manager for XyPriss Server
|
|
7440
|
+
* Handles multer configuration and file upload middleware setup
|
|
7441
|
+
*/
|
|
7442
|
+
|
|
7443
|
+
declare class FileUploadManager {
|
|
7444
|
+
private logger;
|
|
7445
|
+
private config;
|
|
7446
|
+
private multer;
|
|
7447
|
+
private upload;
|
|
7448
|
+
constructor(config: FileUploadConfig, logger: Logger);
|
|
7449
|
+
/**
|
|
7450
|
+
* Initialize the file upload manager
|
|
7451
|
+
*/
|
|
7452
|
+
initialize(): Promise<void>;
|
|
7453
|
+
/**
|
|
7454
|
+
* Create default file filter based on configuration
|
|
7455
|
+
*/
|
|
7456
|
+
private createDefaultFileFilter;
|
|
7457
|
+
/**
|
|
7458
|
+
* Get the multer upload instance
|
|
7459
|
+
*/
|
|
7460
|
+
getUpload(): any;
|
|
7461
|
+
/**
|
|
7462
|
+
* Get single file upload middleware
|
|
7463
|
+
*/
|
|
7464
|
+
single(fieldname: string): any;
|
|
7465
|
+
/**
|
|
7466
|
+
* Get array file upload middleware
|
|
7467
|
+
*/
|
|
7468
|
+
array(fieldname: string, maxCount?: number): any;
|
|
7469
|
+
/**
|
|
7470
|
+
* Get fields file upload middleware
|
|
7471
|
+
*/
|
|
7472
|
+
fields(fields: any[]): any;
|
|
7473
|
+
/**
|
|
7474
|
+
* Get any file upload middleware
|
|
7475
|
+
*/
|
|
7476
|
+
any(): any;
|
|
7477
|
+
/**
|
|
7478
|
+
* Get none file upload middleware (for form data without files)
|
|
7479
|
+
*/
|
|
7480
|
+
none(): any;
|
|
7481
|
+
/**
|
|
7482
|
+
* Check if file upload is enabled
|
|
7483
|
+
*/
|
|
7484
|
+
isEnabled(): boolean;
|
|
7485
|
+
/**
|
|
7486
|
+
* Get current configuration
|
|
7487
|
+
*/
|
|
7488
|
+
getConfig(): FileUploadConfig;
|
|
7489
|
+
}
|
|
7490
|
+
|
|
7491
|
+
/**
|
|
7492
|
+
* Initialize the global file upload manager (legacy)
|
|
7493
|
+
* This is called automatically when the server starts with file upload enabled
|
|
7494
|
+
*/
|
|
7495
|
+
declare function initializeFileUpload(options: any, logger: Logger): void;
|
|
7496
|
+
/**
|
|
7497
|
+
* Create a middleware for uploading a single file (legacy)
|
|
7498
|
+
*/
|
|
7499
|
+
declare function uploadSingle(fieldname: string): (req: any, res: any, next: any) => any;
|
|
7500
|
+
/**
|
|
7501
|
+
* Create a middleware for uploading multiple files with the same field name (legacy)
|
|
7502
|
+
*/
|
|
7503
|
+
declare function uploadArray(fieldname: string, maxCount?: number): (req: any, res: any, next: any) => any;
|
|
7504
|
+
/**
|
|
7505
|
+
* Create a middleware for uploading multiple files with different field names (legacy)
|
|
7506
|
+
*/
|
|
7507
|
+
declare function uploadFields(fields: Array<{
|
|
7508
|
+
name: string;
|
|
7509
|
+
maxCount?: number;
|
|
7510
|
+
}>): (req: any, res: any, next: any) => any;
|
|
7511
|
+
/**
|
|
7512
|
+
* Create a middleware for uploading any files (legacy)
|
|
7513
|
+
*/
|
|
7514
|
+
declare function uploadAny(): (req: any, res: any, next: any) => any;
|
|
7515
|
+
|
|
7437
7516
|
/**
|
|
7438
7517
|
* XyPriss File Upload API
|
|
7439
7518
|
*
|
|
@@ -7505,30 +7584,6 @@ declare class FileUploadAPI {
|
|
|
7505
7584
|
*/
|
|
7506
7585
|
any(): (req: any, res: any, next: any) => any;
|
|
7507
7586
|
}
|
|
7508
|
-
/**
|
|
7509
|
-
* Initialize the global file upload manager (legacy)
|
|
7510
|
-
* This is called automatically when the server starts with file upload enabled
|
|
7511
|
-
*/
|
|
7512
|
-
declare function initializeFileUpload(options: any, logger: Logger): void;
|
|
7513
|
-
/**
|
|
7514
|
-
* Create a middleware for uploading a single file (legacy)
|
|
7515
|
-
*/
|
|
7516
|
-
declare function uploadSingle(fieldname: string): (req: any, res: any, next: any) => any;
|
|
7517
|
-
/**
|
|
7518
|
-
* Create a middleware for uploading multiple files with the same field name (legacy)
|
|
7519
|
-
*/
|
|
7520
|
-
declare function uploadArray(fieldname: string, maxCount?: number): (req: any, res: any, next: any) => any;
|
|
7521
|
-
/**
|
|
7522
|
-
* Create a middleware for uploading multiple files with different field names (legacy)
|
|
7523
|
-
*/
|
|
7524
|
-
declare function uploadFields(fields: Array<{
|
|
7525
|
-
name: string;
|
|
7526
|
-
maxCount?: number;
|
|
7527
|
-
}>): (req: any, res: any, next: any) => any;
|
|
7528
|
-
/**
|
|
7529
|
-
* Create a middleware for uploading any files (legacy)
|
|
7530
|
-
*/
|
|
7531
|
-
declare function uploadAny(): (req: any, res: any, next: any) => any;
|
|
7532
7587
|
|
|
7533
7588
|
interface RouteDefinition {
|
|
7534
7589
|
method: string;
|
|
@@ -12431,5 +12486,5 @@ declare class TrustProxy {
|
|
|
12431
12486
|
*/
|
|
12432
12487
|
declare function Router(): XyPrissRouter;
|
|
12433
12488
|
|
|
12434
|
-
export { CachePlugin as CachePluginBase, CompressionPlugin, ConnectionPlugin, DEFAULT_PLUGIN_CONFIG, FileUploadAPI as FLA, FileUploadAPI, JWTAuthPlugin, NetworkCategory, NetworkPlugin, NetworkPluginFactory, NetworkPluginUtils, PERFORMANCE_TARGETS, PLUGIN_SYSTEM_NAME, PLUGIN_SYSTEM_VERSION, PerformanceMonitor, PerformancePlugin as PerformancePluginBase, PluginDevelopmentHelpers, PluginEngine, PluginEventType, PluginPriority, PluginRegistry, PluginSystemFactory, PluginSystemUtils, PluginType, ProxyPlugin, RateLimitPlugin, ResponseTimePlugin, Route, Router, SecurityMiddleware, SecurityPlugin as SecurityPluginBase, SmartCachePlugin, TrustProxy, XyPrissRouter, createCacheMiddleware, createCircularRefDebugger, createOptimalCache, createSafeJsonMiddleware, createServer, createServerInstance, expressStringify, fastStringify, initializeFileUpload, quickServer, safeJsonStringify, safeStringify, sendSafeJson, setupSafeJson, uploadAny, uploadArray, uploadFields, uploadSingle };
|
|
12435
|
-
export type { BasePlugin, CacheConfig, CachePlugin$1 as CachePlugin, CompressionAlgorithm, CompressionConfig, ConnectionConfig, FailoverConfig, HTTPCacheConfig, HealthCheckConfig, CachePlugin$1 as ICachePlugin, PerformancePlugin$1 as IPerformancePlugin, SecurityPlugin$1 as ISecurityPlugin, LoadBalancingStrategy, MultiServerApp, MultiServerConfig, NativePlugin, NetworkExecutionContext, NetworkExecutionResult, NetworkHealthStatus, NetworkPluginConfig, NetworkSecurityConfig, NextFunction, PerformanceConfig, PerformanceMetrics, PerformancePlugin$1 as PerformancePlugin, PluginConfiguration, PluginEvent, PluginExecutionContext, PluginExecutionResult, PluginExecutionStats, PluginInitializationContext, PluginRegistryConfig, ProxyConfig, RateLimitConfig, RateLimitRule, RateLimitStrategy, RedisConfig, XyPrisRequest as Request, RequestHandler, XyPrisResponse as Response, RouteConfig, RouteOptions, SecurityConfig, SecurityPlugin$1 as SecurityPlugin, ServerOptions, SmartRouteConfig, TrustProxyValue$1 as TrustProxyValue, UltraFastApp, UpstreamServer, WebSocketConfig, MultiServerApp as XyPMS, XyPrisRequest as XyPrissRequest, XyPrisResponse as XyPrissResponse };
|
|
12489
|
+
export { CachePlugin as CachePluginBase, CompressionPlugin, ConnectionPlugin, DEFAULT_PLUGIN_CONFIG, FileUploadAPI as FLA, FileUploadManager as FiUp, FileUploadAPI, JWTAuthPlugin, NetworkCategory, NetworkPlugin, NetworkPluginFactory, NetworkPluginUtils, PERFORMANCE_TARGETS, PLUGIN_SYSTEM_NAME, PLUGIN_SYSTEM_VERSION, PerformanceMonitor, PerformancePlugin as PerformancePluginBase, PluginDevelopmentHelpers, PluginEngine, PluginEventType, PluginPriority, PluginRegistry, PluginSystemFactory, PluginSystemUtils, PluginType, ProxyPlugin, RateLimitPlugin, ResponseTimePlugin, Route, Router, SecurityMiddleware, SecurityPlugin as SecurityPluginBase, SmartCachePlugin, TrustProxy, XyPrissRouter, createCacheMiddleware, createCircularRefDebugger, createOptimalCache, createSafeJsonMiddleware, createServer, createServerInstance, expressStringify, fastStringify, initializeFileUpload, quickServer, safeJsonStringify, safeStringify, sendSafeJson, setupSafeJson, uploadAny, uploadArray, uploadFields, uploadSingle };
|
|
12490
|
+
export type { BasePlugin, CacheConfig, CachePlugin$1 as CachePlugin, CompressionAlgorithm, CompressionConfig, ConnectionConfig, FailoverConfig, FileUploadConfig as FiUpConfig, HTTPCacheConfig, HealthCheckConfig, CachePlugin$1 as ICachePlugin, PerformancePlugin$1 as IPerformancePlugin, SecurityPlugin$1 as ISecurityPlugin, LoadBalancingStrategy, MultiServerApp, MultiServerConfig, NativePlugin, NetworkExecutionContext, NetworkExecutionResult, NetworkHealthStatus, NetworkPluginConfig, NetworkSecurityConfig, NextFunction, PerformanceConfig, PerformanceMetrics, PerformancePlugin$1 as PerformancePlugin, PluginConfiguration, PluginEvent, PluginExecutionContext, PluginExecutionResult, PluginExecutionStats, PluginInitializationContext, PluginRegistryConfig, ProxyConfig, RateLimitConfig, RateLimitRule, RateLimitStrategy, RedisConfig, XyPrisRequest as Request, RequestHandler, XyPrisResponse as Response, RouteConfig, RouteOptions, SecurityConfig, SecurityPlugin$1 as SecurityPlugin, ServerOptions, SmartRouteConfig, TrustProxyValue$1 as TrustProxyValue, UltraFastApp, UpstreamServer, WebSocketConfig, MultiServerApp as XyPMS, XyPrisRequest as XyPrissRequest, XyPrisResponse as XyPrissResponse };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xypriss",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.3",
|
|
4
4
|
"description": "XyPriss is a lightweight, TypeScript-first, open-source Node.js web framework crafted for developers seeking a familiar Express-like API without Express dependencies. It features built-in security middleware, a robust routing system, and performance optimizations to build scalable, secure web applications effortlessly. Join our community and contribute on GitHub!",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"scripts/**/*",
|
|
17
17
|
"scripts/postinstall.js"
|
|
18
18
|
],
|
|
19
|
+
"homepage": "https://xypriss.nehonix.com",
|
|
19
20
|
"scripts": {
|
|
20
21
|
"postinstall": "node scripts/postinstall.js",
|
|
21
22
|
"install-memory-cli": "node scripts/install-memory-cli.js",
|
|
@@ -24,8 +25,7 @@
|
|
|
24
25
|
"test": "jest",
|
|
25
26
|
"test:watch": "jest --watch",
|
|
26
27
|
"test:coverage": "jest --coverage",
|
|
27
|
-
"benchmark": "node benchmarks/index.js"
|
|
28
|
-
"prepublishOnly": "npm run build"
|
|
28
|
+
"benchmark": "node benchmarks/index.js"
|
|
29
29
|
},
|
|
30
30
|
"exports": {
|
|
31
31
|
".": {
|
|
@@ -266,7 +266,7 @@
|
|
|
266
266
|
"tweetnacl": "^1.0.3",
|
|
267
267
|
"ws": "^8.18.2",
|
|
268
268
|
"xss": "^1.0.15",
|
|
269
|
-
"xypriss": "^2.
|
|
269
|
+
"xypriss": "^3.2.2",
|
|
270
270
|
"xypriss-security": "^1.1.10"
|
|
271
271
|
}
|
|
272
272
|
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var hashCore = require('./hash/hash-core.js');
|
|
4
|
-
require('./hash/hash-types.js');
|
|
5
|
-
require('crypto');
|
|
6
|
-
require('./hash/hash-security.js');
|
|
7
|
-
require('./hash/hash-advanced.js');
|
|
8
|
-
require('../algorithms/hash-algorithms.js');
|
|
9
|
-
var crypto = require('./crypto.js');
|
|
10
|
-
var randomCore = require('./random/random-core.js');
|
|
11
|
-
require('./random/random-types.js');
|
|
12
|
-
require('./random/random-sources.js');
|
|
13
|
-
require('nehonix-uri-processor');
|
|
14
|
-
require('../utils/memory/index.js');
|
|
15
|
-
require('../types.js');
|
|
16
|
-
|
|
17
|
-
class Cryptog {
|
|
18
|
-
constructor() {
|
|
19
|
-
this.hash = hashCore.Hash;
|
|
20
|
-
this.crypto = crypto.XyPrissSecurity;
|
|
21
|
-
this.random = randomCore.SecureRandom.getInstance();
|
|
22
|
-
}
|
|
23
|
-
static getInstance() {
|
|
24
|
-
if (!Cryptog.instance) {
|
|
25
|
-
Cryptog.instance = new Cryptog();
|
|
26
|
-
}
|
|
27
|
-
return Cryptog.instance;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* ### Cryptographic Core
|
|
32
|
-
*
|
|
33
|
-
* Primary cryptographic classes and utilities for secure random generation,
|
|
34
|
-
* key management, validation, and buffer operations.
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```typescript
|
|
38
|
-
* import { Cipher } from "xypriss-security";
|
|
39
|
-
*
|
|
40
|
-
* // Generate secure random bytes
|
|
41
|
-
* const randomBytes = Cipher.random.getRandomBytes(32);
|
|
42
|
-
*
|
|
43
|
-
* // Generate secure UUID
|
|
44
|
-
* const uuid = Cipher.random.generateSecureUUID();
|
|
45
|
-
*
|
|
46
|
-
* // Generate random integers
|
|
47
|
-
* const randomInt = Cipher.random.getSecureRandomInt(1, 100);
|
|
48
|
-
* ```
|
|
49
|
-
* @author Seth Eleazar <https://github.com/iDevo-ll>
|
|
50
|
-
* @version 1.1.6
|
|
51
|
-
* @license MIT
|
|
52
|
-
* @see {@link https://lab.nehonix.space/nehonix_viewer/_doc/Nehonix%20XyPrissSecurity} Official Documentation
|
|
53
|
-
*
|
|
54
|
-
*/
|
|
55
|
-
Cryptog.getInstance();
|
|
56
|
-
//# sourceMappingURL=crypt.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"crypt.js","sources":["../../../../../../mods/security/src/core/crypt.ts"],"sourcesContent":[null],"names":["Hash","XyPrissSecurity","SecureRandom"],"mappings":";;;;;;;;;;;;;;;;AAIA,MAAM,OAAO,CAAA;AAOT,IAAA,WAAA,GAAA;QANgB,IAAI,CAAA,IAAA,GAAgBA,aAAI,CAAC;QACzB,IAAM,CAAA,MAAA,GAA2BC,sBAAe,CAAC;AACjD,QAAA,IAAA,CAAA,MAAM,GAAiBC,uBAAY,CAAC,WAAW,EAAE,CAAC;KAI1C;AAEjB,IAAA,OAAO,WAAW,GAAA;AACrB,QAAA,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;AACnB,YAAA,OAAO,CAAC,QAAQ,GAAG,IAAI,OAAO,EAAE,CAAC;SACpC;QACD,OAAO,OAAO,CAAC,QAAQ,CAAC;KAC3B;AACJ,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AACmB,OAAO,CAAC,WAAW;;"}
|