@catbee/utils 0.0.8-rc.4 → 1.0.1
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 +3 -2
- package/build/index.cjs +1271 -950
- package/build/index.d.ts +176 -23
- package/build/index.mjs +1265 -951
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ import { CorsOptions } from 'cors';
|
|
|
37
37
|
/**
|
|
38
38
|
* Logger type for application-wide logging.
|
|
39
39
|
*/
|
|
40
|
-
type Logger =
|
|
40
|
+
type Logger = Logger$1;
|
|
41
41
|
/**
|
|
42
42
|
* Logger levels for application-wide logging.
|
|
43
43
|
*/
|
|
@@ -158,12 +158,14 @@ declare const _globalThis: typeof globalThis;
|
|
|
158
158
|
* - Returns a request-scoped logger from AsyncLocalStorage if available
|
|
159
159
|
* - Falls back to the global (singleton) logger
|
|
160
160
|
* - Initializes the global logger if not created yet
|
|
161
|
+
* - If newInstance is true, returns a fresh logger without any context
|
|
161
162
|
*
|
|
162
|
-
* @
|
|
163
|
+
* @param {boolean} newInstance - If true, returns a fresh logger without any context
|
|
164
|
+
* @returns {Logger} The logger instance (request-bound or global root logger or fresh instance)
|
|
163
165
|
*/
|
|
164
|
-
declare function getLogger(): Logger$1;
|
|
166
|
+
declare function getLogger(newInstance?: boolean): Logger$1;
|
|
165
167
|
/**
|
|
166
|
-
*
|
|
168
|
+
* Returns a fresh logger instance without any request context.
|
|
167
169
|
* This logger is used for logging messages that are not tied to a specific request.
|
|
168
170
|
*/
|
|
169
171
|
declare const logger: pino.Logger;
|
|
@@ -1182,12 +1184,31 @@ declare function createSignedToken(payload: Record<string, any>, secret: string,
|
|
|
1182
1184
|
*/
|
|
1183
1185
|
declare function verifySignedToken(token: string, secret: string): Record<string, any> | null;
|
|
1184
1186
|
|
|
1187
|
+
/**
|
|
1188
|
+
* Parameter decoration definition for method parameters
|
|
1189
|
+
*/
|
|
1190
|
+
interface ParamDefinition {
|
|
1191
|
+
/** Parameter position in method signature */
|
|
1192
|
+
index: number;
|
|
1193
|
+
/** Type of parameter (query, body, etc.) */
|
|
1194
|
+
type: 'query' | 'param' | 'body' | 'req' | 'res' | 'logger' | 'reqHeader' | 'reqId' | 'cookie';
|
|
1195
|
+
/** Optional key for extracting specific property */
|
|
1196
|
+
key?: string;
|
|
1197
|
+
/** Optional ParamOptions for advanced extraction */
|
|
1198
|
+
options?: ParamOptions;
|
|
1199
|
+
}
|
|
1185
1200
|
type Constructor<T = any> = new (...args: any[]) => T;
|
|
1186
1201
|
declare class DIContainer {
|
|
1187
1202
|
private instances;
|
|
1188
1203
|
private constructing;
|
|
1204
|
+
private propertyInjections;
|
|
1189
1205
|
register<T>(target: Constructor<T>): void;
|
|
1206
|
+
/**
|
|
1207
|
+
* Register a property injection to be resolved when the target class is instantiated
|
|
1208
|
+
*/
|
|
1209
|
+
registerPropertyInjection(target: object, propertyKey: string | symbol, injectClass: Constructor): void;
|
|
1190
1210
|
get<T>(target: Constructor<T>): T;
|
|
1211
|
+
private applyPropertyInjections;
|
|
1191
1212
|
clear(): void;
|
|
1192
1213
|
}
|
|
1193
1214
|
/**
|
|
@@ -1203,6 +1224,16 @@ declare function Injectable(): ClassDecorator;
|
|
|
1203
1224
|
* @returns Property decorator that injects the specified class into the property
|
|
1204
1225
|
*/
|
|
1205
1226
|
declare function Inject<T>(targetClass: new (...args: any[]) => T): PropertyDecorator;
|
|
1227
|
+
/**
|
|
1228
|
+
* Inject function for retrieving instances from the DI container.
|
|
1229
|
+
* @param targetClass - The class to inject
|
|
1230
|
+
*
|
|
1231
|
+
* @returns The instance of the requested class
|
|
1232
|
+
*
|
|
1233
|
+
* @example
|
|
1234
|
+
* const a = inject(TestClass);
|
|
1235
|
+
*/
|
|
1236
|
+
declare function inject<T>(targetClass: new (...args: any[]) => T): T;
|
|
1206
1237
|
/**
|
|
1207
1238
|
* Decorator for GET HTTP method routes.
|
|
1208
1239
|
*
|
|
@@ -1299,11 +1330,11 @@ declare const Connect: (path: string) => MethodDecorator;
|
|
|
1299
1330
|
*/
|
|
1300
1331
|
declare function Controller(basePath: string): ClassDecorator;
|
|
1301
1332
|
/**
|
|
1302
|
-
* Decorator that applies middleware to a controller method.
|
|
1333
|
+
* Decorator that applies middleware to a controller method or an entire controller.
|
|
1303
1334
|
* Multiple middlewares can be applied and will execute in order.
|
|
1304
1335
|
*
|
|
1305
1336
|
* @param middlewares - Express middleware functions to apply
|
|
1306
|
-
* @returns Method decorator
|
|
1337
|
+
* @returns Method decorator or Class decorator
|
|
1307
1338
|
*
|
|
1308
1339
|
* @example
|
|
1309
1340
|
* ```ts
|
|
@@ -1312,39 +1343,89 @@ declare function Controller(basePath: string): ClassDecorator;
|
|
|
1312
1343
|
* getProtectedResource() {
|
|
1313
1344
|
* // This route is protected by auth middleware
|
|
1314
1345
|
* }
|
|
1346
|
+
*
|
|
1347
|
+
* @Controller('/api')
|
|
1348
|
+
* @Use(commonMiddleware)
|
|
1349
|
+
* class ApiController {
|
|
1350
|
+
* // All routes in this controller use the middleware
|
|
1351
|
+
* }
|
|
1315
1352
|
* ```
|
|
1316
1353
|
*/
|
|
1317
|
-
declare function Use(...middlewares: RequestHandler[]): MethodDecorator;
|
|
1354
|
+
declare function Use(...middlewares: RequestHandler[]): MethodDecorator & ClassDecorator;
|
|
1355
|
+
/**
|
|
1356
|
+
* Options for parameter decorators
|
|
1357
|
+
* @template T - Type of the parameter value after transformation
|
|
1358
|
+
*
|
|
1359
|
+
* @property type - Base type of the parameter (default: 'string')'
|
|
1360
|
+
* @property dataType - Data structure type (single, array, object)
|
|
1361
|
+
* @property delimiter - Delimiter for array types
|
|
1362
|
+
* @property default - Default value if parameter is missing
|
|
1363
|
+
* @property required - Whether the parameter is required
|
|
1364
|
+
* @property throwError - Throw error on validation failure
|
|
1365
|
+
* @property validate - Custom validation function
|
|
1366
|
+
* @property transform - Custom transformation function
|
|
1367
|
+
*/
|
|
1368
|
+
interface ParamOptions<T = any> {
|
|
1369
|
+
/** Base type of the parameter (default: 'string') */
|
|
1370
|
+
type?: 'string' | 'number' | 'boolean';
|
|
1371
|
+
/** Data structure type (default: 'single') */
|
|
1372
|
+
dataType?: 'single' | 'array' | 'object';
|
|
1373
|
+
/** Delimiter for array types (default: ',') */
|
|
1374
|
+
delimiter?: string;
|
|
1375
|
+
/** Default value if parameter is missing */
|
|
1376
|
+
default?: T;
|
|
1377
|
+
/** Whether the parameter is required (default: false) */
|
|
1378
|
+
required?: boolean;
|
|
1379
|
+
/** Throw error on validation failure (default: true) */
|
|
1380
|
+
throwError?: boolean;
|
|
1381
|
+
/** Minimum value for number type */
|
|
1382
|
+
min?: number;
|
|
1383
|
+
/** Maximum value for number type */
|
|
1384
|
+
max?: number;
|
|
1385
|
+
/** Regex pattern the value must match */
|
|
1386
|
+
pattern?: RegExp;
|
|
1387
|
+
/** Name of the pattern for error messages */
|
|
1388
|
+
patternName?: string;
|
|
1389
|
+
/** Custom validation function */
|
|
1390
|
+
validate?: (value: any) => boolean;
|
|
1391
|
+
/** Custom transformation function */
|
|
1392
|
+
transform?: (value: any) => any;
|
|
1393
|
+
}
|
|
1394
|
+
declare function createParamDecorator(type: ParamDefinition['type'], key?: string): (paramKey?: string) => ParameterDecorator;
|
|
1395
|
+
declare function createParamDecoratorWithoutParam(type: ParamDefinition['type']): () => ParameterDecorator;
|
|
1318
1396
|
/**
|
|
1319
1397
|
* Decorator that extracts query parameters from request.
|
|
1320
1398
|
*
|
|
1321
1399
|
* @param paramKey - Optional key to extract specific query parameter
|
|
1400
|
+
* @param options - Optional ParamOptions
|
|
1322
1401
|
* @returns Parameter decorator
|
|
1323
1402
|
*
|
|
1324
1403
|
* @example
|
|
1325
1404
|
* ```ts
|
|
1326
1405
|
* @Get('/search')
|
|
1327
|
-
* search(@Query('term')
|
|
1328
|
-
* //
|
|
1406
|
+
* search(@Query('term') term: string, @Query('page', { type: 'number', default: 1 }) page: number) {
|
|
1407
|
+
* // term will contain the value of req.query.term
|
|
1408
|
+
* // page will contain the numeric value of req.query.page or default to 1
|
|
1329
1409
|
* }
|
|
1330
1410
|
* ```
|
|
1331
1411
|
*/
|
|
1332
|
-
declare const Query: (paramKey?: string) => ParameterDecorator;
|
|
1412
|
+
declare const Query: (paramKey?: string, options?: ParamOptions) => ParameterDecorator;
|
|
1333
1413
|
/**
|
|
1334
1414
|
* Decorator that extracts route parameters from request.
|
|
1335
1415
|
*
|
|
1336
1416
|
* @param paramKey - Optional key to extract specific route parameter
|
|
1417
|
+
* @param options - Optional ParamOptions
|
|
1337
1418
|
* @returns Parameter decorator
|
|
1338
1419
|
*
|
|
1339
|
-
*
|
|
1420
|
+
* @example
|
|
1340
1421
|
* ```ts
|
|
1341
1422
|
* @Get('/users/:id')
|
|
1342
|
-
* getUser(@Param('id')
|
|
1343
|
-
* //
|
|
1423
|
+
* getUser(@Param('id') id: string) {
|
|
1424
|
+
* // id will contain the value of req.params.id
|
|
1344
1425
|
* }
|
|
1345
1426
|
* ```
|
|
1346
1427
|
*/
|
|
1347
|
-
declare const Param: (paramKey?: string) => ParameterDecorator;
|
|
1428
|
+
declare const Param: (paramKey?: string, options?: ParamOptions) => ParameterDecorator;
|
|
1348
1429
|
/**
|
|
1349
1430
|
* Decorator that extracts body or body property from request.
|
|
1350
1431
|
*
|
|
@@ -1365,6 +1446,60 @@ declare const Param: (paramKey?: string) => ParameterDecorator;
|
|
|
1365
1446
|
* ```
|
|
1366
1447
|
*/
|
|
1367
1448
|
declare const Body: (paramKey?: string) => ParameterDecorator;
|
|
1449
|
+
/**
|
|
1450
|
+
* Decorator that injects a logger instance.
|
|
1451
|
+
* @returns Parameter decorator
|
|
1452
|
+
*
|
|
1453
|
+
* @example
|
|
1454
|
+
* ```ts
|
|
1455
|
+
* @Get('/log')
|
|
1456
|
+
* log(@ReqLogger() logger: Logger) {
|
|
1457
|
+
* logger.info('Logging request...');
|
|
1458
|
+
* }
|
|
1459
|
+
* ```
|
|
1460
|
+
*/
|
|
1461
|
+
declare const ReqLogger: () => ParameterDecorator;
|
|
1462
|
+
/**
|
|
1463
|
+
* Decorator that extracts request ID from headers.
|
|
1464
|
+
* @returns Parameter decorator
|
|
1465
|
+
*
|
|
1466
|
+
* @example
|
|
1467
|
+
* ```ts
|
|
1468
|
+
* @Get('/data')
|
|
1469
|
+
* getData(@ReqId() reqId: string) {
|
|
1470
|
+
* // reqId will contain the value of req.headers['x-request-id'] or req.id
|
|
1471
|
+
* }
|
|
1472
|
+
* ```
|
|
1473
|
+
*/
|
|
1474
|
+
declare const ReqId: () => ParameterDecorator;
|
|
1475
|
+
/**
|
|
1476
|
+
* Decorator that extracts request headers.
|
|
1477
|
+
* @param key - Optional key to extract specific header
|
|
1478
|
+
* @returns Parameter decorator
|
|
1479
|
+
*
|
|
1480
|
+
* @example
|
|
1481
|
+
* ```ts
|
|
1482
|
+
* @Get('/data')
|
|
1483
|
+
* getData(@ReqHeader('Authorization') authHeader: string) {
|
|
1484
|
+
* // authHeader will contain the value of req.headers['authorization']
|
|
1485
|
+
* }
|
|
1486
|
+
* ```
|
|
1487
|
+
*/
|
|
1488
|
+
declare const ReqHeader: (paramKey?: string) => ParameterDecorator;
|
|
1489
|
+
/**
|
|
1490
|
+
* Decorator that extracts cookies from request.
|
|
1491
|
+
* @param key - Optional key to extract specific cookie
|
|
1492
|
+
* @returns Parameter decorator
|
|
1493
|
+
*
|
|
1494
|
+
* @example
|
|
1495
|
+
* ```ts
|
|
1496
|
+
* @Get('/data')
|
|
1497
|
+
* getData(@ReqCookie('session_id') sessionId: string) {
|
|
1498
|
+
* // sessionId will contain the value of req.cookies['session_id']
|
|
1499
|
+
* }
|
|
1500
|
+
* ```
|
|
1501
|
+
*/
|
|
1502
|
+
declare const ReqCookie: (paramKey?: string) => ParameterDecorator;
|
|
1368
1503
|
/**
|
|
1369
1504
|
* Decorator that injects the entire request object.
|
|
1370
1505
|
*
|
|
@@ -1379,7 +1514,7 @@ declare const Body: (paramKey?: string) => ParameterDecorator;
|
|
|
1379
1514
|
* }
|
|
1380
1515
|
* ```
|
|
1381
1516
|
*/
|
|
1382
|
-
declare const Req: (
|
|
1517
|
+
declare const Req: () => ParameterDecorator;
|
|
1383
1518
|
/**
|
|
1384
1519
|
* Decorator that injects the response object.
|
|
1385
1520
|
*
|
|
@@ -1394,7 +1529,7 @@ declare const Req: (paramKey?: string) => ParameterDecorator;
|
|
|
1394
1529
|
* }
|
|
1395
1530
|
* ```
|
|
1396
1531
|
*/
|
|
1397
|
-
declare const Res: (
|
|
1532
|
+
declare const Res: () => ParameterDecorator;
|
|
1398
1533
|
/**
|
|
1399
1534
|
* Decorator that sets a custom HTTP status code for a response.
|
|
1400
1535
|
*
|
|
@@ -1464,7 +1599,7 @@ declare function Headers(headers: Record<string, string> | string, value?: strin
|
|
|
1464
1599
|
* Useful for pre-processing or logging.
|
|
1465
1600
|
*
|
|
1466
1601
|
* @param fn - Function to execute before the handler
|
|
1467
|
-
* @returns Method decorator
|
|
1602
|
+
* @returns Method decorator or Class decorator
|
|
1468
1603
|
*
|
|
1469
1604
|
* @example
|
|
1470
1605
|
* ```ts
|
|
@@ -1473,15 +1608,21 @@ declare function Headers(headers: Record<string, string> | string, value?: strin
|
|
|
1473
1608
|
* getUser(@Param('id') id: string) {
|
|
1474
1609
|
* // Function will log before this handler runs
|
|
1475
1610
|
* }
|
|
1611
|
+
*
|
|
1612
|
+
* @Controller('/api')
|
|
1613
|
+
* @Before((req, res) => console.log(`API access: ${req.path}`))
|
|
1614
|
+
* class ApiController {
|
|
1615
|
+
* // Hook runs before all routes in this controller
|
|
1616
|
+
* }
|
|
1476
1617
|
* ```
|
|
1477
1618
|
*/
|
|
1478
|
-
declare function Before(fn: Function): MethodDecorator;
|
|
1619
|
+
declare function Before(fn: Function): MethodDecorator & ClassDecorator;
|
|
1479
1620
|
/**
|
|
1480
1621
|
* Decorator that registers a function to run after route handler execution.
|
|
1481
1622
|
* Can access the handler's result.
|
|
1482
1623
|
*
|
|
1483
1624
|
* @param fn - Function to execute after the handler
|
|
1484
|
-
* @returns Method decorator
|
|
1625
|
+
* @returns Method decorator or Class decorator
|
|
1485
1626
|
*
|
|
1486
1627
|
* @example
|
|
1487
1628
|
* ```ts
|
|
@@ -1491,9 +1632,15 @@ declare function Before(fn: Function): MethodDecorator;
|
|
|
1491
1632
|
* // After this handler, the function will log the returned data
|
|
1492
1633
|
* return { id, name: 'Example' };
|
|
1493
1634
|
* }
|
|
1635
|
+
*
|
|
1636
|
+
* @Controller('/api')
|
|
1637
|
+
* @After((req, res, result) => console.log(`API response: ${JSON.stringify(result)}`))
|
|
1638
|
+
* class ApiController {
|
|
1639
|
+
* // Hook runs after all routes in this controller
|
|
1640
|
+
* }
|
|
1494
1641
|
* ```
|
|
1495
1642
|
*/
|
|
1496
|
-
declare function After(fn: Function): MethodDecorator;
|
|
1643
|
+
declare function After(fn: Function): MethodDecorator & ClassDecorator;
|
|
1497
1644
|
/**
|
|
1498
1645
|
* Decorator that requires specific roles for accessing a route.
|
|
1499
1646
|
* Must be used with authentication middleware.
|
|
@@ -1585,7 +1732,7 @@ declare function RateLimit(options: {
|
|
|
1585
1732
|
* Decorator that sets the content type for the response.
|
|
1586
1733
|
*
|
|
1587
1734
|
* @param type - MIME type for the response
|
|
1588
|
-
* @returns Method decorator
|
|
1735
|
+
* @returns Method decorator or Class decorator
|
|
1589
1736
|
*
|
|
1590
1737
|
* @example
|
|
1591
1738
|
* ```ts
|
|
@@ -1594,9 +1741,15 @@ declare function RateLimit(options: {
|
|
|
1594
1741
|
* downloadPdf() {
|
|
1595
1742
|
* return this.fileService.generatePdf();
|
|
1596
1743
|
* }
|
|
1744
|
+
*
|
|
1745
|
+
* @Controller('/api/json')
|
|
1746
|
+
* @ContentType('application/json')
|
|
1747
|
+
* class JsonApiController {
|
|
1748
|
+
* // All routes in this controller use this content type
|
|
1749
|
+
* }
|
|
1597
1750
|
* ```
|
|
1598
1751
|
*/
|
|
1599
|
-
declare function ContentType(type: string): MethodDecorator;
|
|
1752
|
+
declare function ContentType(type: string): MethodDecorator & ClassDecorator;
|
|
1600
1753
|
/**
|
|
1601
1754
|
* Decorator that adds API versioning to a route.
|
|
1602
1755
|
*
|
|
@@ -5128,4 +5281,4 @@ declare class ServerConfigBuilder {
|
|
|
5128
5281
|
private setEnabled;
|
|
5129
5282
|
}
|
|
5130
5283
|
|
|
5131
|
-
export { After, type ApiErrorResponse, type ApiResponse, type ApiSuccessResponse, type AsyncOperationResponse, type Awaited$1 as Awaited, BUILD_MARKER, BadGatewayException, BadRequestException, type BatchResponse, Before, Body, type BufferEncoding, Cache, CircuitBreakerOpenError, type CircuitBreakerOptions, CircuitBreakerState, ConflictException, Connect, ContentType, ContextStore, Controller, DIContainer, type DecryptionOptions, type DeepPartial, type DeepReadonly, type DeepRequired, type DeepStringifyOrNull, Delete, type EncryptionOptions, type EncryptionResult, Env, Environment, type ErrorHandlerOptions, ErrorResponse, ExpressServer, ForbiddenException, type Func, GatewayTimeoutException, Get, Head, Header, Headers, HttpCode, HttpError, HttpStatusCodes, Inject, Injectable, InsufficientStorageException, InternalServerErrorException, type IsEqual, type KeysOfType, Log, type Logger, type LoggerLevels, type MaybePromise, MethodNotAllowedException, type Middleware, type Mutable, NoContentResponse, type NonEmptyArray, NotAcceptableException, NotFoundException, type Nullable, type Optional, type Optional2, Options, PaginatedResponse, type Pagination, type PaginationParams, type PaginationResponse, Param, type PartialPick, Patch, type PathOptions, PayloadTooLargeException, type PickByType, Post, type Primitive, Put, Query, RateLimit, type RecordOptional, Redirect, RedirectResponse, Req, RequestTimeoutException, type RequireAtLeastOne, Res, Roles, type ServerConfig, ServerConfigBuilder, type ServerHooks, ServiceUnavailableException, SortDirection, type Store, StoreKeys, type StreamResponse, type StringKeyedRecord, SuccessResponse, TTLCache, type TTLCacheOptions, type TaskQueue, Timeout, type ToggleConfig, TooManyRequestsException, Trace, TypedContextKey, UnauthorizedException, type UnionToIntersection, UnprocessableEntityException, UnsupportedMediaTypeException, type UrlOptions, Use, type ValidationOptions, type ValidationResult, type ValueOf, Version, type WithPagination, type Without, type Writable, _globalThis, abortable, addRedactFields, addSensitiveFields, appendQueryParams, appendTextFile, capitalize, chunk, circuitBreaker, compact, copyDir, copyFile, countBy, countOccurrences, createChildLogger, createDeferred, createDirectory, createErrorResponse, createFinalErrorResponse, createHttpError, createPaginatedResponse, createRequestLogger, createSignedToken, createSuccessResponse, createTaskQueue, createTempDir, createTempFile, createUrlBuilder, debounce, decrypt, deepFreeze, deepObjMerge, defaultSensitiveFields, deleteDirRecursive, deleteFileIfExists, difference, emptyDir, encrypt, ensureDir, ensureEmptyDir, equalsIgnoreCase, errorHandler, extractFilterParams, extractPaginationParams, extractQueryParams, extractSortParams, fileExists, filterObject, findFilesByPattern, findInDir, findNewestFile, findOldestFile, flattenDeep, flattenObject, generateApiKey, generateRandomBytes, generateRandomBytesAsString, getAllPaths, getConfig, getDirSize, getDirStats, getDomain, getErrorMessage, getExtension, getFileSize, getFileStats, getFromContext, getLogger, getPaginationParams, getRedactCensor, getRequestId, getSubdirectories, getValueByPath, groupBy, hasErrorShape, hasRequiredProps, hash, healthCheck, hmac, intersect, isAlpha, isAlphanumeric, isArray, isBase64, isCreditCard, isDateInRange, isDirectory, isEmail, isEqual, isFile, isHexColor, isHttpError, isIPv4, isIPv6, isISODate, isLengthBetween, isNumberBetween, isNumeric, isObjEmpty, isObject, isPhone, isPlainObject, isPort, isStrongPassword, isURL, isUUID, isValidJSON, isValidUrl, joinPaths, listFiles, logError, logger, mapObject, mask, matchesPattern, md5, memoizeAsync, mergeSort, moveDir, moveFile, nanoId, normalizeUrl, omit, parseBooleanParam, parseNumberParam, parseQueryString, parseTypedQueryParams, partition, pick, pluck, random, randomBase64, randomHex, randomInt, randomString, range, rateLimit, readDirectory, readFileBuffer, readJsonFile, readTextFile, redact, registerControllers, removeQueryParams, requestId, responseTime, retry, reverse, runInBatches, runInSeries, runWithConcurrency, safeCompare, safeReadJsonFile, sendResponse, setConfig, setRedactCensor, setSensitiveFields, setValueByPath, settleAll, setupRequestContext, sha1, sha256, sha256Hmac, shuffle, singletonAsync, sleep, slugify, streamFile, stripHtml, take, takeWhile, throttle, timeout, toCamelCase, toKebabCase, toPascalCase, toSnakeCase, truncate, unique, uuid, validateAll, verifySignedToken, walkDir, watchDir, watchDirRecursive, waterfall, withErrorHandling, withTimeout, writeJsonFile, writeTextFile, zip };
|
|
5284
|
+
export { After, type ApiErrorResponse, type ApiResponse, type ApiSuccessResponse, type AsyncOperationResponse, type Awaited$1 as Awaited, BUILD_MARKER, BadGatewayException, BadRequestException, type BatchResponse, Before, Body, type BufferEncoding, Cache, CircuitBreakerOpenError, type CircuitBreakerOptions, CircuitBreakerState, ConflictException, Connect, ContentType, ContextStore, Controller, DIContainer, type DecryptionOptions, type DeepPartial, type DeepReadonly, type DeepRequired, type DeepStringifyOrNull, Delete, type EncryptionOptions, type EncryptionResult, Env, Environment, type ErrorHandlerOptions, ErrorResponse, ExpressServer, ForbiddenException, type Func, GatewayTimeoutException, Get, Head, Header, Headers, HttpCode, HttpError, HttpStatusCodes, Inject, Injectable, InsufficientStorageException, InternalServerErrorException, type IsEqual, type KeysOfType, Log, type Logger, type LoggerLevels, type MaybePromise, MethodNotAllowedException, type Middleware, type Mutable, NoContentResponse, type NonEmptyArray, NotAcceptableException, NotFoundException, type Nullable, type Optional, type Optional2, Options, PaginatedResponse, type Pagination, type PaginationParams, type PaginationResponse, Param, type ParamOptions, type PartialPick, Patch, type PathOptions, PayloadTooLargeException, type PickByType, Post, type Primitive, Put, Query, RateLimit, type RecordOptional, Redirect, RedirectResponse, Req, ReqCookie, ReqHeader, ReqId, ReqLogger, RequestTimeoutException, type RequireAtLeastOne, Res, Roles, type ServerConfig, ServerConfigBuilder, type ServerHooks, ServiceUnavailableException, SortDirection, type Store, StoreKeys, type StreamResponse, type StringKeyedRecord, SuccessResponse, TTLCache, type TTLCacheOptions, type TaskQueue, Timeout, type ToggleConfig, TooManyRequestsException, Trace, TypedContextKey, UnauthorizedException, type UnionToIntersection, UnprocessableEntityException, UnsupportedMediaTypeException, type UrlOptions, Use, type ValidationOptions, type ValidationResult, type ValueOf, Version, type WithPagination, type Without, type Writable, _globalThis, abortable, addRedactFields, addSensitiveFields, appendQueryParams, appendTextFile, capitalize, chunk, circuitBreaker, compact, copyDir, copyFile, countBy, countOccurrences, createChildLogger, createDeferred, createDirectory, createErrorResponse, createFinalErrorResponse, createHttpError, createPaginatedResponse, createParamDecorator, createParamDecoratorWithoutParam, createRequestLogger, createSignedToken, createSuccessResponse, createTaskQueue, createTempDir, createTempFile, createUrlBuilder, debounce, decrypt, deepFreeze, deepObjMerge, defaultSensitiveFields, deleteDirRecursive, deleteFileIfExists, difference, emptyDir, encrypt, ensureDir, ensureEmptyDir, equalsIgnoreCase, errorHandler, extractFilterParams, extractPaginationParams, extractQueryParams, extractSortParams, fileExists, filterObject, findFilesByPattern, findInDir, findNewestFile, findOldestFile, flattenDeep, flattenObject, generateApiKey, generateRandomBytes, generateRandomBytesAsString, getAllPaths, getConfig, getDirSize, getDirStats, getDomain, getErrorMessage, getExtension, getFileSize, getFileStats, getFromContext, getLogger, getPaginationParams, getRedactCensor, getRequestId, getSubdirectories, getValueByPath, groupBy, hasErrorShape, hasRequiredProps, hash, healthCheck, hmac, inject, intersect, isAlpha, isAlphanumeric, isArray, isBase64, isCreditCard, isDateInRange, isDirectory, isEmail, isEqual, isFile, isHexColor, isHttpError, isIPv4, isIPv6, isISODate, isLengthBetween, isNumberBetween, isNumeric, isObjEmpty, isObject, isPhone, isPlainObject, isPort, isStrongPassword, isURL, isUUID, isValidJSON, isValidUrl, joinPaths, listFiles, logError, logger, mapObject, mask, matchesPattern, md5, memoizeAsync, mergeSort, moveDir, moveFile, nanoId, normalizeUrl, omit, parseBooleanParam, parseNumberParam, parseQueryString, parseTypedQueryParams, partition, pick, pluck, random, randomBase64, randomHex, randomInt, randomString, range, rateLimit, readDirectory, readFileBuffer, readJsonFile, readTextFile, redact, registerControllers, removeQueryParams, requestId, responseTime, retry, reverse, runInBatches, runInSeries, runWithConcurrency, safeCompare, safeReadJsonFile, sendResponse, setConfig, setRedactCensor, setSensitiveFields, setValueByPath, settleAll, setupRequestContext, sha1, sha256, sha256Hmac, shuffle, singletonAsync, sleep, slugify, streamFile, stripHtml, take, takeWhile, throttle, timeout, toCamelCase, toKebabCase, toPascalCase, toSnakeCase, truncate, unique, uuid, validateAll, verifySignedToken, walkDir, watchDir, watchDirRecursive, waterfall, withErrorHandling, withTimeout, writeJsonFile, writeTextFile, zip };
|