elseware-nodejs 1.11.2 → 1.11.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/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -4
- package/dist/index.d.ts +8 -4
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -10,12 +10,16 @@ import { SignOptions, JwtPayload } from 'jsonwebtoken';
|
|
|
10
10
|
|
|
11
11
|
declare const DEFAULT_ALLOWED_ORIGINS: string[];
|
|
12
12
|
|
|
13
|
-
interface LoadEnvOptions<TSchema extends ZodTypeAny
|
|
13
|
+
interface LoadEnvOptions<TSchema extends ZodTypeAny> {
|
|
14
14
|
schema: TSchema;
|
|
15
|
-
|
|
15
|
+
}
|
|
16
|
+
interface LoadEnvTransformOptions<TSchema extends ZodTypeAny, TTransform> {
|
|
17
|
+
schema: TSchema;
|
|
18
|
+
transform: (env: infer<TSchema>) => TTransform;
|
|
16
19
|
}
|
|
17
20
|
|
|
18
|
-
declare function loadEnv<TSchema extends ZodTypeAny
|
|
21
|
+
declare function loadEnv<TSchema extends ZodTypeAny>(options: LoadEnvOptions<TSchema>): infer<TSchema>;
|
|
22
|
+
declare function loadEnv<TSchema extends ZodTypeAny, TTransform>(options: LoadEnvTransformOptions<TSchema, TTransform>): TTransform;
|
|
19
23
|
|
|
20
24
|
interface AppErrorOptions {
|
|
21
25
|
code?: string;
|
|
@@ -2336,4 +2340,4 @@ declare function toMinutes(ms: number): number;
|
|
|
2336
2340
|
declare function toHours(ms: number): number;
|
|
2337
2341
|
declare function sleep(ms: number): Promise<void>;
|
|
2338
2342
|
|
|
2339
|
-
export { AVLTree, AdjacencyList, AdjacencyMatrix, type AdjacentEdge, type AllowedOriginsOptions, ApiFeatures, type ApiMeta, ApiResponse, type ApiResponseOptions, AppError, type AppErrorOptions, AsyncHandler, type AsyncRequestHandler, type AuthStrategy, type AuthenticatedUser, type AzureBlobStorageConfig, AzureBlobStorageService, BPlusTree, BTree, BearerTokenStrategy, BinaryHeap, BinarySearchTree, BinaryTree, BloomFilter, CircularArray, CircularLinkedList, CircularQueue, type CloudinaryConfig, CloudinaryService, ConsistentHash, CorrelationId, CountMinSketch, CrudControllerFactory, type CrudControllerOptions, DEFAULT_ALLOWED_ORIGINS, DEFAULT_LIMIT, DEFAULT_PAGE, DEFAULT_SORT_DIRECTION, type DatabaseConnectionOptions, DatabaseManager, type DatabaseProvider, Deque, type DirectedEdge, DirectedGraph, DisjointSetUnion, DoublyLinkedList, DynamicArray, type Edge, type EmailProvider, EmailService, type ErrorMeta, ErrorMiddleware, type ExponentialBackoffOptions, ExponentialBackoffRetryPolicy, FenwickTree, FibNode, FibonacciHeap, type Filter, FixedRetryPolicy, type FixedRetryPolicyOptions, Graph, HashMap, HashSet, HttpClient, type HttpClientOptions, HyperLogLog, type IValidator, InternalServiceClient, type Interval, IntervalTree, JWTService, type JWTServiceOptions, JoiValidator, KDTree, LFUCache, LRUCache, type LoadEnvOptions, Logger, type LoggerOptions, MaxHeap, MaxStack, MinHeap, MinStack, type MongoDatabaseConfig, MongoDatabaseProvider, MongoRepository, MulterFileHandlerService, MultiSet, Node, OrderedSet, type PaginationMeta, type PaginationQuery, PairingHeap, PairingNode, type ParsedQuery, type PickOptions, type Point, type Point2D, PriorityQueue, type ProgressCallback, QUERY_RESERVED_FIELDS, QuadTree, type QueryFilter, type QueryOperator, type QueryOptions, type QuerySort, Queue, RadixTree, type Rect, RedBlackTree, type Repository, RequestContext, type RequestContextData, type RequestContextOptions, type RetryPolicy, SMTPProvider, SUPPORTED_OPERATORS, SegmentTree, type Select, type SendEmailOptions, ServiceClient, type ServiceResponse, Set, SinglyLinkedList, type Sort, SparseTable, SplayTree, Stack, type StandardApiResponse, StaticArray, StaticTokenProvider, SuffixArray, SuffixTree, TemplateEngine, TernarySearchTree, type TokenProvider, TracingHeaders, TreeNode, Trie, type UpdateQueryOptions, type UploadOptions, type ValidationResult, type ValidationSchema, ZodValidator, authMiddleware, createAllowedOrigins, createCorsOptions, createRequestContextMiddleware, days, errorToString, hours, isJoiSchema, isZodSchema, loadEnv, logger, milliseconds, minutes, pickFields, seconds, sleep, toHours, toMinutes, toSeconds, validate };
|
|
2343
|
+
export { AVLTree, AdjacencyList, AdjacencyMatrix, type AdjacentEdge, type AllowedOriginsOptions, ApiFeatures, type ApiMeta, ApiResponse, type ApiResponseOptions, AppError, type AppErrorOptions, AsyncHandler, type AsyncRequestHandler, type AuthStrategy, type AuthenticatedUser, type AzureBlobStorageConfig, AzureBlobStorageService, BPlusTree, BTree, BearerTokenStrategy, BinaryHeap, BinarySearchTree, BinaryTree, BloomFilter, CircularArray, CircularLinkedList, CircularQueue, type CloudinaryConfig, CloudinaryService, ConsistentHash, CorrelationId, CountMinSketch, CrudControllerFactory, type CrudControllerOptions, DEFAULT_ALLOWED_ORIGINS, DEFAULT_LIMIT, DEFAULT_PAGE, DEFAULT_SORT_DIRECTION, type DatabaseConnectionOptions, DatabaseManager, type DatabaseProvider, Deque, type DirectedEdge, DirectedGraph, DisjointSetUnion, DoublyLinkedList, DynamicArray, type Edge, type EmailProvider, EmailService, type ErrorMeta, ErrorMiddleware, type ExponentialBackoffOptions, ExponentialBackoffRetryPolicy, FenwickTree, FibNode, FibonacciHeap, type Filter, FixedRetryPolicy, type FixedRetryPolicyOptions, Graph, HashMap, HashSet, HttpClient, type HttpClientOptions, HyperLogLog, type IValidator, InternalServiceClient, type Interval, IntervalTree, JWTService, type JWTServiceOptions, JoiValidator, KDTree, LFUCache, LRUCache, type LoadEnvOptions, type LoadEnvTransformOptions, Logger, type LoggerOptions, MaxHeap, MaxStack, MinHeap, MinStack, type MongoDatabaseConfig, MongoDatabaseProvider, MongoRepository, MulterFileHandlerService, MultiSet, Node, OrderedSet, type PaginationMeta, type PaginationQuery, PairingHeap, PairingNode, type ParsedQuery, type PickOptions, type Point, type Point2D, PriorityQueue, type ProgressCallback, QUERY_RESERVED_FIELDS, QuadTree, type QueryFilter, type QueryOperator, type QueryOptions, type QuerySort, Queue, RadixTree, type Rect, RedBlackTree, type Repository, RequestContext, type RequestContextData, type RequestContextOptions, type RetryPolicy, SMTPProvider, SUPPORTED_OPERATORS, SegmentTree, type Select, type SendEmailOptions, ServiceClient, type ServiceResponse, Set, SinglyLinkedList, type Sort, SparseTable, SplayTree, Stack, type StandardApiResponse, StaticArray, StaticTokenProvider, SuffixArray, SuffixTree, TemplateEngine, TernarySearchTree, type TokenProvider, TracingHeaders, TreeNode, Trie, type UpdateQueryOptions, type UploadOptions, type ValidationResult, type ValidationSchema, ZodValidator, authMiddleware, createAllowedOrigins, createCorsOptions, createRequestContextMiddleware, days, errorToString, hours, isJoiSchema, isZodSchema, loadEnv, logger, milliseconds, minutes, pickFields, seconds, sleep, toHours, toMinutes, toSeconds, validate };
|
package/dist/index.d.ts
CHANGED
|
@@ -10,12 +10,16 @@ import { SignOptions, JwtPayload } from 'jsonwebtoken';
|
|
|
10
10
|
|
|
11
11
|
declare const DEFAULT_ALLOWED_ORIGINS: string[];
|
|
12
12
|
|
|
13
|
-
interface LoadEnvOptions<TSchema extends ZodTypeAny
|
|
13
|
+
interface LoadEnvOptions<TSchema extends ZodTypeAny> {
|
|
14
14
|
schema: TSchema;
|
|
15
|
-
|
|
15
|
+
}
|
|
16
|
+
interface LoadEnvTransformOptions<TSchema extends ZodTypeAny, TTransform> {
|
|
17
|
+
schema: TSchema;
|
|
18
|
+
transform: (env: infer<TSchema>) => TTransform;
|
|
16
19
|
}
|
|
17
20
|
|
|
18
|
-
declare function loadEnv<TSchema extends ZodTypeAny
|
|
21
|
+
declare function loadEnv<TSchema extends ZodTypeAny>(options: LoadEnvOptions<TSchema>): infer<TSchema>;
|
|
22
|
+
declare function loadEnv<TSchema extends ZodTypeAny, TTransform>(options: LoadEnvTransformOptions<TSchema, TTransform>): TTransform;
|
|
19
23
|
|
|
20
24
|
interface AppErrorOptions {
|
|
21
25
|
code?: string;
|
|
@@ -2336,4 +2340,4 @@ declare function toMinutes(ms: number): number;
|
|
|
2336
2340
|
declare function toHours(ms: number): number;
|
|
2337
2341
|
declare function sleep(ms: number): Promise<void>;
|
|
2338
2342
|
|
|
2339
|
-
export { AVLTree, AdjacencyList, AdjacencyMatrix, type AdjacentEdge, type AllowedOriginsOptions, ApiFeatures, type ApiMeta, ApiResponse, type ApiResponseOptions, AppError, type AppErrorOptions, AsyncHandler, type AsyncRequestHandler, type AuthStrategy, type AuthenticatedUser, type AzureBlobStorageConfig, AzureBlobStorageService, BPlusTree, BTree, BearerTokenStrategy, BinaryHeap, BinarySearchTree, BinaryTree, BloomFilter, CircularArray, CircularLinkedList, CircularQueue, type CloudinaryConfig, CloudinaryService, ConsistentHash, CorrelationId, CountMinSketch, CrudControllerFactory, type CrudControllerOptions, DEFAULT_ALLOWED_ORIGINS, DEFAULT_LIMIT, DEFAULT_PAGE, DEFAULT_SORT_DIRECTION, type DatabaseConnectionOptions, DatabaseManager, type DatabaseProvider, Deque, type DirectedEdge, DirectedGraph, DisjointSetUnion, DoublyLinkedList, DynamicArray, type Edge, type EmailProvider, EmailService, type ErrorMeta, ErrorMiddleware, type ExponentialBackoffOptions, ExponentialBackoffRetryPolicy, FenwickTree, FibNode, FibonacciHeap, type Filter, FixedRetryPolicy, type FixedRetryPolicyOptions, Graph, HashMap, HashSet, HttpClient, type HttpClientOptions, HyperLogLog, type IValidator, InternalServiceClient, type Interval, IntervalTree, JWTService, type JWTServiceOptions, JoiValidator, KDTree, LFUCache, LRUCache, type LoadEnvOptions, Logger, type LoggerOptions, MaxHeap, MaxStack, MinHeap, MinStack, type MongoDatabaseConfig, MongoDatabaseProvider, MongoRepository, MulterFileHandlerService, MultiSet, Node, OrderedSet, type PaginationMeta, type PaginationQuery, PairingHeap, PairingNode, type ParsedQuery, type PickOptions, type Point, type Point2D, PriorityQueue, type ProgressCallback, QUERY_RESERVED_FIELDS, QuadTree, type QueryFilter, type QueryOperator, type QueryOptions, type QuerySort, Queue, RadixTree, type Rect, RedBlackTree, type Repository, RequestContext, type RequestContextData, type RequestContextOptions, type RetryPolicy, SMTPProvider, SUPPORTED_OPERATORS, SegmentTree, type Select, type SendEmailOptions, ServiceClient, type ServiceResponse, Set, SinglyLinkedList, type Sort, SparseTable, SplayTree, Stack, type StandardApiResponse, StaticArray, StaticTokenProvider, SuffixArray, SuffixTree, TemplateEngine, TernarySearchTree, type TokenProvider, TracingHeaders, TreeNode, Trie, type UpdateQueryOptions, type UploadOptions, type ValidationResult, type ValidationSchema, ZodValidator, authMiddleware, createAllowedOrigins, createCorsOptions, createRequestContextMiddleware, days, errorToString, hours, isJoiSchema, isZodSchema, loadEnv, logger, milliseconds, minutes, pickFields, seconds, sleep, toHours, toMinutes, toSeconds, validate };
|
|
2343
|
+
export { AVLTree, AdjacencyList, AdjacencyMatrix, type AdjacentEdge, type AllowedOriginsOptions, ApiFeatures, type ApiMeta, ApiResponse, type ApiResponseOptions, AppError, type AppErrorOptions, AsyncHandler, type AsyncRequestHandler, type AuthStrategy, type AuthenticatedUser, type AzureBlobStorageConfig, AzureBlobStorageService, BPlusTree, BTree, BearerTokenStrategy, BinaryHeap, BinarySearchTree, BinaryTree, BloomFilter, CircularArray, CircularLinkedList, CircularQueue, type CloudinaryConfig, CloudinaryService, ConsistentHash, CorrelationId, CountMinSketch, CrudControllerFactory, type CrudControllerOptions, DEFAULT_ALLOWED_ORIGINS, DEFAULT_LIMIT, DEFAULT_PAGE, DEFAULT_SORT_DIRECTION, type DatabaseConnectionOptions, DatabaseManager, type DatabaseProvider, Deque, type DirectedEdge, DirectedGraph, DisjointSetUnion, DoublyLinkedList, DynamicArray, type Edge, type EmailProvider, EmailService, type ErrorMeta, ErrorMiddleware, type ExponentialBackoffOptions, ExponentialBackoffRetryPolicy, FenwickTree, FibNode, FibonacciHeap, type Filter, FixedRetryPolicy, type FixedRetryPolicyOptions, Graph, HashMap, HashSet, HttpClient, type HttpClientOptions, HyperLogLog, type IValidator, InternalServiceClient, type Interval, IntervalTree, JWTService, type JWTServiceOptions, JoiValidator, KDTree, LFUCache, LRUCache, type LoadEnvOptions, type LoadEnvTransformOptions, Logger, type LoggerOptions, MaxHeap, MaxStack, MinHeap, MinStack, type MongoDatabaseConfig, MongoDatabaseProvider, MongoRepository, MulterFileHandlerService, MultiSet, Node, OrderedSet, type PaginationMeta, type PaginationQuery, PairingHeap, PairingNode, type ParsedQuery, type PickOptions, type Point, type Point2D, PriorityQueue, type ProgressCallback, QUERY_RESERVED_FIELDS, QuadTree, type QueryFilter, type QueryOperator, type QueryOptions, type QuerySort, Queue, RadixTree, type Rect, RedBlackTree, type Repository, RequestContext, type RequestContextData, type RequestContextOptions, type RetryPolicy, SMTPProvider, SUPPORTED_OPERATORS, SegmentTree, type Select, type SendEmailOptions, ServiceClient, type ServiceResponse, Set, SinglyLinkedList, type Sort, SparseTable, SplayTree, Stack, type StandardApiResponse, StaticArray, StaticTokenProvider, SuffixArray, SuffixTree, TemplateEngine, TernarySearchTree, type TokenProvider, TracingHeaders, TreeNode, Trie, type UpdateQueryOptions, type UploadOptions, type ValidationResult, type ValidationSchema, ZodValidator, authMiddleware, createAllowedOrigins, createCorsOptions, createRequestContextMiddleware, days, errorToString, hours, isJoiSchema, isZodSchema, loadEnv, logger, milliseconds, minutes, pickFields, seconds, sleep, toHours, toMinutes, toSeconds, validate };
|
package/dist/index.js
CHANGED
|
@@ -128,7 +128,7 @@ function loadEnv(options) {
|
|
|
128
128
|
function handleValidationError(error) {
|
|
129
129
|
logger.error("Environment validation failed");
|
|
130
130
|
const grouped = {};
|
|
131
|
-
error.issues
|
|
131
|
+
for (const issue of error.issues) {
|
|
132
132
|
const key = issue.path.join(".") || "unknown";
|
|
133
133
|
const rawValue = key !== "unknown" ? process.env[key] : void 0;
|
|
134
134
|
const safeValue = key.toLowerCase().includes("secret") ? "***" : rawValue;
|
|
@@ -139,7 +139,7 @@ function handleValidationError(error) {
|
|
|
139
139
|
].filter(Boolean).join(" | ");
|
|
140
140
|
grouped[key] ??= [];
|
|
141
141
|
grouped[key].push(message);
|
|
142
|
-
}
|
|
142
|
+
}
|
|
143
143
|
Object.entries(grouped).forEach(([key, messages]) => {
|
|
144
144
|
logger.error(`ENV: ${key}`);
|
|
145
145
|
messages.forEach((message) => logger.error(` - ${message}`));
|