@kalutskii/foundation 0.7.22 → 0.7.25

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +463 -429
  2. package/dist/index.js +954 -644
  3. package/package.json +8 -9
package/dist/index.d.ts CHANGED
@@ -1,10 +1,9 @@
1
- import { SQL } from 'drizzle-orm';
2
- import { ErrorHandler, Context, TypedResponse, MiddlewareHandler } from 'hono';
3
- import * as kleur_colors from 'kleur/colors';
4
- import z$1, { z, ZodObject, ZodRawShape } from 'zod';
5
- import { Locale } from 'date-fns';
6
- import { SymmetricAlgorithm } from 'hono/utils/jwt/jwa';
7
-
1
+ import { SQL } from "drizzle-orm";
2
+ import { Locale } from "date-fns";
3
+ import z, { ZodObject, ZodRawShape, z as z$1 } from "zod";
4
+ import { Context, ErrorHandler, MiddlewareHandler, TypedResponse } from "hono";
5
+ import { SymmetricAlgorithm } from "hono/utils/jwt/jwa";
6
+ //#region src/drizzle/drizzle.refiners.d.ts
8
7
  /**
9
8
  * Builds a Drizzle `WHERE` clause by combining defined object entries with `and`.
10
9
  * Expects the supplied keys to be validated against the table beforehand.
@@ -13,58 +12,63 @@ import { SymmetricAlgorithm } from 'hono/utils/jwt/jwa';
13
12
  * await db.update(usersTable).set(values).where(sqlWhere(usersTable, { id: 1 })).returning();
14
13
  */
15
14
  declare function sqlWhere(table: unknown, where: Record<string, unknown>): SQL;
16
-
15
+ //#endregion
16
+ //#region src/hono/hono.execution.d.ts
17
17
  /**
18
18
  * Converts expected `HTTPException` values into shared API error envelopes.
19
19
  * Unexpected failures are logged and represented by a traceable generic response.
20
20
  */
21
21
  declare const onHandlerError: ErrorHandler;
22
-
22
+ //#endregion
23
+ //#region src/http/http.constants.d.ts
23
24
  declare const SUCCESS_STATUS_CODES: readonly [200, 201, 202, 307];
24
25
  declare const EXCEPTION_STATUS_CODES: readonly [400, 401, 403, 404, 405, 409, 500];
25
-
26
+ //#endregion
27
+ //#region src/http/http.types.d.ts
26
28
  type SuccessStatusCode = (typeof SUCCESS_STATUS_CODES)[number];
27
29
  type ExceptionStatusCode = (typeof EXCEPTION_STATUS_CODES)[number];
28
30
  type APISuccess<TData = void> = {
29
- kind: 'data';
30
- status: SuccessStatusCode;
31
- data: TData;
31
+ kind: 'data';
32
+ status: SuccessStatusCode;
33
+ data: TData;
32
34
  };
33
35
  type APIError = {
34
- kind: 'error';
35
- status: ExceptionStatusCode;
36
- error: string;
36
+ kind: 'error';
37
+ status: ExceptionStatusCode;
38
+ error: string;
37
39
  };
38
40
  type APIContractResult<TData = void> = APISuccess<TData> | APIError;
39
41
  type APIContractData<TResult extends APIContractResult<unknown>> = TResult extends APISuccess<infer TData> ? TData : never;
40
42
  type APIContractError<TResult extends APIContractResult<unknown>> = Extract<TResult, APIError>;
41
43
  type FetchResult<TData> = {
42
- error: null;
43
- data: TData;
44
+ error: null;
45
+ data: TData;
44
46
  } | {
45
- error: string;
46
- data: null;
47
+ error: string;
48
+ data: null;
47
49
  };
48
-
50
+ //#endregion
51
+ //#region src/hono/hono.types.d.ts
49
52
  /**
50
53
  * Options for a typed JSON response wrapped in the shared API success envelope.
51
54
  * The status generic preserves the literal code inferred by the route contract.
52
55
  */
53
56
  type HonoRespondOptions<TData extends object, TStatus extends SuccessStatusCode> = {
54
- status: TStatus;
55
- data?: TData;
57
+ status: TStatus;
58
+ data?: TData;
56
59
  };
57
60
  /**
58
61
  * Options for a downloadable binary response with attachment metadata.
59
62
  * The content type remains optional and falls back to a generic binary type.
60
63
  */
61
64
  type HonoFileRespondOptions<TStatus extends SuccessStatusCode> = {
62
- status: TStatus;
63
- content: Uint8Array<ArrayBuffer>;
64
- filename: string;
65
- contentType?: string;
65
+ status: TStatus;
66
+ content: Uint8Array<ArrayBuffer>;
67
+ filename: string;
68
+ contentType?: string;
66
69
  };
67
-
70
+ //#endregion
71
+ //#region src/hono/hono.respond.d.ts
68
72
  /**
69
73
  * Wraps `c.json` in the shared success envelope while preserving its literal status.
70
74
  * Missing response data is represented by an empty object for contract consistency.
@@ -75,7 +79,8 @@ declare function respond<T extends object = Record<string, never>, S extends Suc
75
79
  * Unknown/undefined content types default to `application/octet-stream`.
76
80
  */
77
81
  declare function fileRespond<S extends SuccessStatusCode>(c: Context, options: HonoFileRespondOptions<S>): Response;
78
-
82
+ //#endregion
83
+ //#region src/hmac/hmac.constants.d.ts
79
84
  /**
80
85
  * Default digest algorithm used by `HMACService` when none is configured.
81
86
  * SHA-256 provides broad Web Crypto support and a 256-bit authentication tag.
@@ -86,32 +91,34 @@ declare const DEFAULT_HMAC_ALGORITHM: "SHA-256";
86
91
  * Hex output remains deterministic, portable, and independent of padding rules.
87
92
  */
88
93
  declare const DEFAULT_HMAC_ENCODING: "hex";
89
-
90
- declare const hmacAlgorithmsArray: readonly ["SHA-256", "SHA-384", "SHA-512"];
94
+ //#endregion
95
+ //#region src/hmac/hmac.enums.d.ts
96
+ declare const hmacAlgorithmsArray: readonly ['SHA-256', 'SHA-384', 'SHA-512'];
91
97
  type HMACAlgorithm = (typeof hmacAlgorithmsArray)[number];
92
98
  declare const hmacAlgorithmsRecord: Readonly<{
93
- SHA_256: "SHA-256";
94
- SHA_384: "SHA-384";
95
- SHA_512: "SHA-512";
99
+ SHA_256: "SHA-256";
100
+ SHA_384: "SHA-384";
101
+ SHA_512: "SHA-512";
96
102
  }>;
97
103
  declare const hmacAlgorithm: Readonly<{
98
- SHA_256: "SHA-256";
99
- SHA_384: "SHA-384";
100
- SHA_512: "SHA-512";
104
+ SHA_256: "SHA-256";
105
+ SHA_384: "SHA-384";
106
+ SHA_512: "SHA-512";
101
107
  }>;
102
- declare const hmacEncodingsArray: readonly ["hex", "base64", "base64url"];
108
+ declare const hmacEncodingsArray: readonly ['hex', 'base64', 'base64url'];
103
109
  type HMACEncoding = (typeof hmacEncodingsArray)[number];
104
110
  declare const hmacEncodingsRecord: Readonly<{
105
- HEX: "hex";
106
- BASE64: "base64";
107
- BASE64URL: "base64url";
111
+ BASE64: "base64";
112
+ BASE64URL: "base64url";
113
+ HEX: "hex";
108
114
  }>;
109
115
  declare const hmacEncoding: Readonly<{
110
- HEX: "hex";
111
- BASE64: "base64";
112
- BASE64URL: "base64url";
116
+ BASE64: "base64";
117
+ BASE64URL: "base64url";
118
+ HEX: "hex";
113
119
  }>;
114
-
120
+ //#endregion
121
+ //#region src/hmac/hmac.types.d.ts
115
122
  /**
116
123
  * Binary-safe input accepted as either an HMAC payload or a secret key.
117
124
  * Strings use UTF-8 encoding while byte arrays preserve their exact contents.
@@ -122,45 +129,47 @@ type HMACInput = string | Uint8Array;
122
129
  * Omitted values select SHA-256 and lowercase hexadecimal output by default.
123
130
  */
124
131
  type HMACServiceOptions = Readonly<{
125
- /**
126
- * Web Crypto digest algorithm used to authenticate every payload.
127
- * The service defaults to `SHA-256` when this option is omitted.
128
- */
129
- algorithm?: HMACAlgorithm;
130
- /**
131
- * Text encoding applied to generated and verified signatures.
132
- * The service defaults to `hex` when this option is omitted.
133
- */
134
- encoding?: HMACEncoding;
132
+ /**
133
+ * Web Crypto digest algorithm used to authenticate every payload.
134
+ * The service defaults to `SHA-256` when this option is omitted.
135
+ */
136
+ algorithm?: HMACAlgorithm;
137
+ /**
138
+ * Text encoding applied to generated and verified signatures.
139
+ * The service defaults to `hex` when this option is omitted.
140
+ */
141
+ encoding?: HMACEncoding;
135
142
  }>;
136
-
143
+ //#endregion
144
+ //#region src/hmac/hmac.services.d.ts
137
145
  /**
138
146
  * Creates and verifies keyed message authentication codes through Web Crypto.
139
147
  * Each instance preserves its digest algorithm and textual encoding configuration.
140
148
  */
141
149
  declare class HMACService {
142
- readonly algorithm: HMACAlgorithm;
143
- readonly encoding: HMACEncoding;
144
- constructor(options?: HMACServiceOptions);
145
- /**
146
- * Authenticates a payload with a secret and returns the encoded signature.
147
- * String inputs use UTF-8 while byte arrays preserve their exact byte sequence.
148
- *
149
- * @example
150
- * const signature = await hmacService.sign('payload', 'shared-secret');
151
- */
152
- sign(payload: HMACInput, secret: HMACInput): Promise<string>;
153
- /**
154
- * Verifies an encoded signature without requiring a manual equality comparison.
155
- * Invalid encodings, incorrect secrets, and altered payloads all resolve to `false`.
156
- *
157
- * @example
158
- * const verified = await hmacService.verify('payload', signature, 'shared-secret');
159
- */
160
- verify(payload: HMACInput, signature: string, secret: HMACInput): Promise<boolean>;
161
- private importSecret;
150
+ readonly algorithm: HMACAlgorithm;
151
+ readonly encoding: HMACEncoding;
152
+ constructor(options?: HMACServiceOptions);
153
+ /**
154
+ * Authenticates a payload with a secret and returns the encoded signature.
155
+ * String inputs use UTF-8 while byte arrays preserve their exact byte sequence.
156
+ *
157
+ * @example
158
+ * const signature = await hmacService.sign('payload', 'shared-secret');
159
+ */
160
+ sign(payload: HMACInput, secret: HMACInput): Promise<string>;
161
+ /**
162
+ * Verifies an encoded signature without requiring a manual equality comparison.
163
+ * Invalid encodings, incorrect secrets, and altered payloads all resolve to `false`.
164
+ *
165
+ * @example
166
+ * const verified = await hmacService.verify('payload', signature, 'shared-secret');
167
+ */
168
+ verify(payload: HMACInput, signature: string, secret: HMACInput): Promise<boolean>;
169
+ private importSecret;
162
170
  }
163
-
171
+ //#endregion
172
+ //#region src/hmac/hmac.utilities.d.ts
164
173
  /**
165
174
  * Converts an HMAC payload or secret into an isolated byte array representation.
166
175
  * Strings use UTF-8 while supplied bytes are copied to prevent later mutation.
@@ -176,24 +185,26 @@ declare function encodeHMACSignature(signature: Uint8Array, encoding: HMACEncodi
176
185
  * Malformed alphabets, lengths, or padding combinations reject with `TypeError`.
177
186
  */
178
187
  declare function decodeHMACSignature(signature: string, encoding: HMACEncoding): Uint8Array<ArrayBuffer>;
179
-
188
+ //#endregion
189
+ //#region src/http/http.factory.d.ts
180
190
  /**
181
191
  * Creates a successful API envelope without cloning its data.
182
192
  * Generic inference preserves the exact supplied payload type.
183
193
  */
184
194
  declare function success<T = unknown>({ status, data }: {
185
- status: SuccessStatusCode;
186
- data: T;
195
+ status: SuccessStatusCode;
196
+ data: T;
187
197
  }): APISuccess<T>;
188
198
  /**
189
199
  * Creates a failed API envelope with one supported exception status.
190
200
  * The supplied message remains unchanged for downstream presentation.
191
201
  */
192
202
  declare function failure({ status, error }: {
193
- status: ExceptionStatusCode;
194
- error: string;
203
+ status: ExceptionStatusCode;
204
+ error: string;
195
205
  }): APIError;
196
-
206
+ //#endregion
207
+ //#region src/http/http.resolvers.d.ts
197
208
  /**
198
209
  * Converts an API contract envelope into a mutually exclusive safe result.
199
210
  * Only `APIError` values are normalized; rejected fetchers still reject.
@@ -204,15 +215,16 @@ declare function fetchSafely<TResult extends APIContractResult<unknown>>(fetcher
204
215
  * Rejected fetchers propagate their original error without replacement.
205
216
  */
206
217
  declare function fetchAndThrow<TResult extends APIContractResult<unknown>>(fetcher: () => Promise<TResult>): Promise<APIContractData<TResult>>;
207
-
218
+ //#endregion
219
+ //#region src/logging/logging.constants.d.ts
208
220
  /**
209
221
  * Terminal color configuration for every supported logging level.
210
222
  * The `LogLevel` contract prevents missing or unsupported level entries.
211
223
  */
212
224
  declare const logLevelColors: {
213
- readonly info: typeof kleur_colors.print;
214
- readonly warn: typeof kleur_colors.print;
215
- readonly error: typeof kleur_colors.print;
225
+ readonly info: typeof import("kleur/colors").print;
226
+ readonly warn: typeof import("kleur/colors").print;
227
+ readonly error: typeof import("kleur/colors").print;
216
228
  };
217
229
  /**
218
230
  * Public placeholder written instead of sensitive query and JSON values.
@@ -223,41 +235,44 @@ declare const REDACTED_LOG_VALUE = "[redacted]";
223
235
  * Normalized key fragments treated as sensitive by logging redaction.
224
236
  * Matching ignores case and separators so compound field names remain covered.
225
237
  */
226
- declare const sensitiveLogKeyParts: readonly ["password", "passwd", "token", "secret", "authorization", "apikey", "credential"];
238
+ declare const sensitiveLogKeyParts: readonly ['password', 'passwd', 'token', 'secret', 'authorization', 'apikey', 'credential'];
227
239
  /**
228
240
  * Terminal colors assigned to the supported HTTP response status ranges.
229
241
  * Unlisted ranges intentionally retain the terminal's default text appearance.
230
242
  */
231
243
  declare const httpStatusColors: readonly [{
232
- readonly range: readonly [200, 299];
233
- readonly color: typeof kleur_colors.print;
244
+ readonly range: readonly [200, 299];
245
+ readonly color: typeof import("kleur/colors").print;
234
246
  }, {
235
- readonly range: readonly [400, 499];
236
- readonly color: typeof kleur_colors.print;
247
+ readonly range: readonly [400, 499];
248
+ readonly color: typeof import("kleur/colors").print;
237
249
  }, {
238
- readonly range: readonly [500, 599];
239
- readonly color: typeof kleur_colors.print;
250
+ readonly range: readonly [500, 599];
251
+ readonly color: typeof import("kleur/colors").print;
240
252
  }];
241
-
242
- declare const logLevelsArray: readonly ["info", "warn", "error"];
253
+ //#endregion
254
+ //#region src/logging/logging.enums.d.ts
255
+ declare const logLevelsArray: readonly ['info', 'warn', 'error'];
243
256
  type LogLevel = (typeof logLevelsArray)[number];
244
257
  declare const logLevelsRecord: Readonly<{
245
- ERROR: "error";
246
- INFO: "info";
247
- WARN: "warn";
258
+ ERROR: "error";
259
+ INFO: "info";
260
+ WARN: "warn";
248
261
  }>;
249
262
  declare const logLevel: Readonly<{
250
- ERROR: "error";
251
- INFO: "info";
252
- WARN: "warn";
263
+ ERROR: "error";
264
+ INFO: "info";
265
+ WARN: "warn";
253
266
  }>;
254
-
267
+ //#endregion
268
+ //#region src/logging/logging.middleware.d.ts
255
269
  /**
256
270
  * Logs Hono request metadata with query parameters and a normalized body preview.
257
271
  * Sensitive values are redacted by partial key match before output is written.
258
272
  */
259
273
  declare const loggingMiddleware: MiddlewareHandler;
260
-
274
+ //#endregion
275
+ //#region src/logging/logging.security.d.ts
261
276
  /**
262
277
  * Replaces sensitive query values using partial, case-insensitive key matching.
263
278
  * A new collection is returned so the caller's search parameters remain unchanged.
@@ -268,217 +283,223 @@ declare function redactSensitiveSearchParams(searchParams: URLSearchParams): URL
268
283
  * Invalid JSON and payloads without matching keys are returned byte-for-byte unchanged.
269
284
  */
270
285
  declare function redactSensitiveJSON(json: string): string;
271
-
286
+ //#endregion
287
+ //#region src/logging/logging.services.d.ts
272
288
  /**
273
289
  * Writes timestamped and colorized messages using a stable service column.
274
290
  * Error messages may include a stack trace on a subordinate second line.
275
291
  */
276
292
  declare const log: {
277
- /**
278
- * Writes an informational message with an optional service label.
279
- * Missing service names use the shared `log` fallback label.
280
- */
281
- info(message: string, service?: string): void;
282
- /**
283
- * Writes a warning message with an optional service label.
284
- * Missing service names use the shared `log` fallback label.
285
- */
286
- warn(message: string, service?: string): void;
287
- /**
288
- * Writes an error message with optional service and stack trace context.
289
- * Provided stack traces are rendered beneath the primary message.
290
- */
291
- error(message: string, service?: string, stack?: string): void;
293
+ /**
294
+ * Writes an informational message with an optional service label.
295
+ * Missing service names use the shared `log` fallback label.
296
+ */
297
+ info(message: string, service?: string): void;
298
+ /**
299
+ * Writes a warning message with an optional service label.
300
+ * Missing service names use the shared `log` fallback label.
301
+ */
302
+ warn(message: string, service?: string): void;
303
+ /**
304
+ * Writes an error message with optional service and stack trace context.
305
+ * Provided stack traces are rendered beneath the primary message.
306
+ */
307
+ error(message: string, service?: string, stack?: string): void;
292
308
  };
293
-
309
+ //#endregion
310
+ //#region src/logging/logging.utilities.d.ts
294
311
  /**
295
312
  * Selects a terminal color function for one HTTP response status.
296
313
  * Successes are green, client errors yellow, and server errors red.
297
314
  */
298
315
  declare function getColoredHTTPStatus(status: number): (text: string) => string;
299
-
316
+ //#endregion
317
+ //#region src/upload/upload.constants.d.ts
300
318
  /**
301
319
  * Canonical metadata shared by upload controls and runtime validation.
302
320
  * Every supported format defines display, MIME, and extension values.
303
321
  */
304
322
  declare const fileFormatsConfig: {
305
- readonly png: {
306
- readonly name: "PNG";
307
- readonly mimeTypes: readonly ["image/png"];
308
- readonly extensions: readonly [".png"];
309
- };
310
- readonly jpg: {
311
- readonly name: "JPG";
312
- readonly mimeTypes: readonly ["image/jpeg"];
313
- readonly extensions: readonly [".jpg", ".jpeg"];
314
- };
315
- readonly svg: {
316
- readonly name: "SVG";
317
- readonly mimeTypes: readonly ["image/svg+xml"];
318
- readonly extensions: readonly [".svg"];
319
- };
320
- readonly webp: {
321
- readonly name: "WEBP";
322
- readonly mimeTypes: readonly ["image/webp"];
323
- readonly extensions: readonly [".webp"];
324
- };
325
- readonly avif: {
326
- readonly name: "AVIF";
327
- readonly mimeTypes: readonly ["image/avif"];
328
- readonly extensions: readonly [".avif"];
329
- };
330
- readonly heic: {
331
- readonly name: "HEIC";
332
- readonly mimeTypes: readonly ["image/heic", "image/heif"];
333
- readonly extensions: readonly [".heic", ".heif"];
334
- };
335
- readonly pdf: {
336
- readonly name: "PDF";
337
- readonly mimeTypes: readonly ["application/pdf"];
338
- readonly extensions: readonly [".pdf"];
339
- };
340
- readonly rtf: {
341
- readonly name: "RTF";
342
- readonly mimeTypes: readonly ["application/rtf"];
343
- readonly extensions: readonly [".rtf"];
344
- };
345
- readonly txt: {
346
- readonly name: "TXT";
347
- readonly mimeTypes: readonly ["text/plain"];
348
- readonly extensions: readonly [".txt"];
349
- };
323
+ readonly png: {
324
+ readonly name: 'PNG';
325
+ readonly mimeTypes: readonly ["image/png"];
326
+ readonly extensions: readonly [".png"];
327
+ };
328
+ readonly jpg: {
329
+ readonly name: 'JPG';
330
+ readonly mimeTypes: readonly ["image/jpeg"];
331
+ readonly extensions: readonly [".jpg", ".jpeg"];
332
+ };
333
+ readonly svg: {
334
+ readonly name: 'SVG';
335
+ readonly mimeTypes: readonly ["image/svg+xml"];
336
+ readonly extensions: readonly [".svg"];
337
+ };
338
+ readonly webp: {
339
+ readonly name: 'WEBP';
340
+ readonly mimeTypes: readonly ["image/webp"];
341
+ readonly extensions: readonly [".webp"];
342
+ };
343
+ readonly avif: {
344
+ readonly name: 'AVIF';
345
+ readonly mimeTypes: readonly ["image/avif"];
346
+ readonly extensions: readonly [".avif"];
347
+ };
348
+ readonly heic: {
349
+ readonly name: 'HEIC';
350
+ readonly mimeTypes: readonly ["image/heic", "image/heif"];
351
+ readonly extensions: readonly [".heic", ".heif"];
352
+ };
353
+ readonly pdf: {
354
+ readonly name: 'PDF';
355
+ readonly mimeTypes: readonly ["application/pdf"];
356
+ readonly extensions: readonly [".pdf"];
357
+ };
358
+ readonly rtf: {
359
+ readonly name: 'RTF';
360
+ readonly mimeTypes: readonly ["application/rtf"];
361
+ readonly extensions: readonly [".rtf"];
362
+ };
363
+ readonly txt: {
364
+ readonly name: 'TXT';
365
+ readonly mimeTypes: readonly ["text/plain"];
366
+ readonly extensions: readonly [".txt"];
367
+ };
350
368
  };
351
-
369
+ //#endregion
370
+ //#region src/upload/upload.enums.d.ts
352
371
  declare const fileFormatsArray: readonly ["png", "jpg", "webp", "avif", "heic", "svg", "pdf", "rtf", "txt"];
353
372
  type FileFormat = (typeof fileFormatsArray)[number];
354
373
  declare const fileFormatsRecord: Readonly<{
355
- AVIF: "avif";
356
- JPG: "jpg";
357
- PDF: "pdf";
358
- PNG: "png";
359
- RTF: "rtf";
360
- SVG: "svg";
361
- TXT: "txt";
362
- WEBP: "webp";
363
- HEIC: "heic";
374
+ AVIF: "avif";
375
+ HEIC: "heic";
376
+ JPG: "jpg";
377
+ PDF: "pdf";
378
+ PNG: "png";
379
+ RTF: "rtf";
380
+ SVG: "svg";
381
+ TXT: "txt";
382
+ WEBP: "webp";
364
383
  }>;
365
384
  declare const fileFormat: Readonly<{
366
- AVIF: "avif";
367
- JPG: "jpg";
368
- PDF: "pdf";
369
- PNG: "png";
370
- RTF: "rtf";
371
- SVG: "svg";
372
- TXT: "txt";
373
- WEBP: "webp";
374
- HEIC: "heic";
385
+ AVIF: "avif";
386
+ HEIC: "heic";
387
+ JPG: "jpg";
388
+ PDF: "pdf";
389
+ PNG: "png";
390
+ RTF: "rtf";
391
+ SVG: "svg";
392
+ TXT: "txt";
393
+ WEBP: "webp";
375
394
  }>;
376
- declare const uploadValidationErrorsArray: readonly ["empty_file", "unsupported_file_format", "file_size_exceeded", "files_count_exceeded"];
395
+ declare const uploadValidationErrorsArray: readonly ['empty_file', 'unsupported_file_format', 'file_size_exceeded', 'files_count_exceeded'];
377
396
  type UploadValidationError = (typeof uploadValidationErrorsArray)[number];
378
397
  declare const uploadValidationErrorsRecord: Readonly<{
379
- EMPTY_FILE: "empty_file";
380
- UNSUPPORTED_FILE_FORMAT: "unsupported_file_format";
381
- FILE_SIZE_EXCEEDED: "file_size_exceeded";
382
- FILES_COUNT_EXCEEDED: "files_count_exceeded";
398
+ EMPTY_FILE: "empty_file";
399
+ FILES_COUNT_EXCEEDED: "files_count_exceeded";
400
+ FILE_SIZE_EXCEEDED: "file_size_exceeded";
401
+ UNSUPPORTED_FILE_FORMAT: "unsupported_file_format";
383
402
  }>;
384
403
  declare const uploadValidationError: Readonly<{
385
- EMPTY_FILE: "empty_file";
386
- UNSUPPORTED_FILE_FORMAT: "unsupported_file_format";
387
- FILE_SIZE_EXCEEDED: "file_size_exceeded";
388
- FILES_COUNT_EXCEEDED: "files_count_exceeded";
404
+ EMPTY_FILE: "empty_file";
405
+ FILES_COUNT_EXCEEDED: "files_count_exceeded";
406
+ FILE_SIZE_EXCEEDED: "file_size_exceeded";
407
+ UNSUPPORTED_FILE_FORMAT: "unsupported_file_format";
389
408
  }>;
390
-
409
+ //#endregion
410
+ //#region src/upload/upload.types.d.ts
391
411
  type FileFormatConfig = (typeof fileFormatsConfig)[FileFormat];
392
412
  /**
393
413
  * Shared upload policy consumed by browser controls and backend validation.
394
414
  * One preset keeps format, size, capacity, and fallback rules synchronized.
395
415
  */
396
416
  type UploadPreset<TFormats extends readonly FileFormat[] = readonly FileFormat[]> = Readonly<{
397
- /**
398
- * Supported formats accepted by every consumer of the preset.
399
- * Const inference preserves the supplied format tuple without widening.
400
- */
401
- formats: TFormats;
402
- /**
403
- * Maximum accepted size of one uploaded file measured in bytes.
404
- * Schema and client validation can share this exact numeric boundary.
405
- */
406
- maxFileSize: number;
407
- /**
408
- * Optional maximum number of files retained by one upload collection.
409
- * Single-file controls can set this value to `1` for shared capacity rules.
410
- */
411
- maxFilesCount?: number;
412
- /**
413
- * Allows extensions to compensate for absent or unreliable MIME metadata.
414
- * The fallback remains disabled when this option is omitted.
415
- */
416
- extensionFallback?: boolean;
417
+ /**
418
+ * Supported formats accepted by every consumer of the preset.
419
+ * Const inference preserves the supplied format tuple without widening.
420
+ */
421
+ formats: TFormats;
422
+ /**
423
+ * Maximum accepted size of one uploaded file measured in bytes.
424
+ * Schema and client validation can share this exact numeric boundary.
425
+ */
426
+ maxFileSize: number;
427
+ /**
428
+ * Optional maximum number of files retained by one upload collection.
429
+ * Single-file controls can set this value to `1` for shared capacity rules.
430
+ */
431
+ maxFilesCount?: number;
432
+ /**
433
+ * Allows extensions to compensate for absent or unreliable MIME metadata.
434
+ * The fallback remains disabled when this option is omitted.
435
+ */
436
+ extensionFallback?: boolean;
417
437
  }>;
418
438
  /**
419
439
  * Constraints used to validate an incoming collection of browser files.
420
440
  * Existing and incoming counts are combined when enforcing capacity.
421
441
  */
422
442
  type UploadFilesValidationOptions = Readonly<{
423
- /**
424
- * Number of files already retained before the incoming batch is validated.
425
- * Existing entries reduce the remaining capacity without being revalidated.
426
- */
427
- currentFilesCount: number;
428
- /**
429
- * Supported formats used to validate every file in the incoming batch.
430
- * MIME and extension metadata are resolved through the canonical catalog.
431
- */
432
- formats: readonly FileFormat[];
433
- /**
434
- * Maximum accepted size of one uploaded file measured in bytes.
435
- * Files exceeding this boundary receive the stable size error key.
436
- */
437
- maxFileSize: number;
438
- /**
439
- * Optional maximum number of retained files after accepting the batch.
440
- * Omitting this value leaves collection capacity unrestricted.
441
- */
442
- maxFilesCount?: number;
443
+ /**
444
+ * Number of files already retained before the incoming batch is validated.
445
+ * Existing entries reduce the remaining capacity without being revalidated.
446
+ */
447
+ currentFilesCount: number;
448
+ /**
449
+ * Supported formats used to validate every file in the incoming batch.
450
+ * MIME and extension metadata are resolved through the canonical catalog.
451
+ */
452
+ formats: readonly FileFormat[];
453
+ /**
454
+ * Maximum accepted size of one uploaded file measured in bytes.
455
+ * Files exceeding this boundary receive the stable size error key.
456
+ */
457
+ maxFileSize: number;
458
+ /**
459
+ * Optional maximum number of retained files after accepting the batch.
460
+ * Omitting this value leaves collection capacity unrestricted.
461
+ */
462
+ maxFilesCount?: number;
443
463
  }>;
444
464
  /**
445
465
  * Accepted files and the final rejection encountered in one batch.
446
466
  * Valid entries remain available when another entry fails validation.
447
467
  */
448
468
  type UploadFilesValidationResult = Readonly<{
449
- /**
450
- * Valid incoming files that fit the remaining collection capacity.
451
- * Accepted file objects preserve their original identity and ordering.
452
- */
453
- acceptedFiles: File[];
454
- /**
455
- * Final stable rejection encountered while processing the incoming batch.
456
- * The field remains absent when every supplied file is accepted.
457
- */
458
- validationError?: UploadValidationError;
469
+ /**
470
+ * Valid incoming files that fit the remaining collection capacity.
471
+ * Accepted file objects preserve their original identity and ordering.
472
+ */
473
+ acceptedFiles: File[];
474
+ /**
475
+ * Final stable rejection encountered while processing the incoming batch.
476
+ * The field remains absent when every supplied file is accepted.
477
+ */
478
+ validationError?: UploadValidationError;
459
479
  }>;
460
480
  /**
461
481
  * Options used to construct one reusable Zod file schema.
462
482
  * Extension fallback is disabled by default to preserve strict MIME checks.
463
483
  */
464
484
  type ZodUploadFileSchemaOptions = Readonly<{
465
- /**
466
- * Supported formats accepted by the generated file schema.
467
- * Strict MIME validation uses metadata from the canonical format catalog.
468
- */
469
- formats: readonly FileFormat[];
470
- /**
471
- * Maximum accepted file size measured in bytes for the generated file schema.
472
- * Empty files remain invalid independently of this configured boundary.
473
- */
474
- maxFileSize: number;
475
- /**
476
- * Allows a supported extension to compensate for missing MIME metadata.
477
- * The fallback remains disabled by default to preserve strict validation.
478
- */
479
- extensionFallback?: boolean;
485
+ /**
486
+ * Supported formats accepted by the generated file schema.
487
+ * Strict MIME validation uses metadata from the canonical format catalog.
488
+ */
489
+ formats: readonly FileFormat[];
490
+ /**
491
+ * Maximum accepted file size measured in bytes for the generated file schema.
492
+ * Empty files remain invalid independently of this configured boundary.
493
+ */
494
+ maxFileSize: number;
495
+ /**
496
+ * Allows a supported extension to compensate for missing MIME metadata.
497
+ * The fallback remains disabled by default to preserve strict validation.
498
+ */
499
+ extensionFallback?: boolean;
480
500
  }>;
481
-
501
+ //#endregion
502
+ //#region src/upload/upload.factory.d.ts
482
503
  /**
483
504
  * Defines one shared upload policy while preserving its literal format tuple.
484
505
  * The resulting preset can drive schemas, picker hints, and batch validation.
@@ -491,7 +512,8 @@ type ZodUploadFileSchemaOptions = Readonly<{
491
512
  * });
492
513
  */
493
514
  declare function defineUploadPreset<const TFormats extends readonly FileFormat[]>(preset: UploadPreset<TFormats>): UploadPreset<TFormats>;
494
-
515
+ //#endregion
516
+ //#region src/upload/upload.presets.d.ts
495
517
  /**
496
518
  * Default maximum size of one file accepted by the built-in upload presets.
497
519
  * The 20 MiB boundary matches the existing upload component policy.
@@ -502,38 +524,40 @@ declare const DEFAULT_UPLOAD_MAX_FILE_SIZE: number;
502
524
  * Each image may occupy up to 20 MiB while collection capacity remains unrestricted.
503
525
  */
504
526
  declare const imageUploadPreset: Readonly<{
505
- formats: readonly ["png", "jpg", "webp", "avif", "heic"];
506
- maxFileSize: number;
507
- maxFilesCount?: number;
508
- extensionFallback?: boolean;
527
+ formats: readonly ["png", "jpg", "webp", "avif", "heic"];
528
+ maxFileSize: number;
529
+ maxFilesCount?: number;
530
+ extensionFallback?: boolean;
509
531
  }>;
510
532
  /**
511
533
  * Ready-to-use policy for every image format supporting transparency (alpha channel).
512
534
  * Each image may occupy up to 20 MiB while collection capacity remains unrestricted.
513
535
  */
514
536
  declare const imageTransparentUploadPreset: Readonly<{
515
- formats: readonly ["png", "webp", "svg"];
516
- maxFileSize: number;
517
- maxFilesCount?: number;
518
- extensionFallback?: boolean;
537
+ formats: readonly ["png", "webp", "svg"];
538
+ maxFileSize: number;
539
+ maxFilesCount?: number;
540
+ extensionFallback?: boolean;
519
541
  }>;
520
542
  /**
521
543
  * Ready-to-use policy for every document format supported by the upload catalog.
522
544
  * Each document may occupy up to 20 MiB while collection capacity remains unrestricted.
523
545
  */
524
546
  declare const documentUploadPreset: Readonly<{
525
- formats: readonly ["pdf", "rtf", "txt"];
526
- maxFileSize: number;
527
- maxFilesCount?: number;
528
- extensionFallback?: boolean;
547
+ formats: readonly ["pdf", "rtf", "txt"];
548
+ maxFileSize: number;
549
+ maxFilesCount?: number;
550
+ extensionFallback?: boolean;
529
551
  }>;
530
-
552
+ //#endregion
553
+ //#region src/upload/upload.schemas.d.ts
531
554
  /**
532
555
  * Builds a reusable Zod schema for one uploaded file with format and size.
533
556
  * MIME matching is strict unless extension fallback is explicitly enabled.
534
557
  */
535
- declare function zodUploadFileSchema(options: ZodUploadFileSchemaOptions): z.ZodFile;
536
-
558
+ declare function zodUploadFileSchema(options: ZodUploadFileSchemaOptions): z$1.ZodFile;
559
+ //#endregion
560
+ //#region src/upload/upload.utilities.d.ts
537
561
  /**
538
562
  * Extracts a normalized trailing extension from a complete file name.
539
563
  * Returns an empty string when no valid dot-delimited suffix exists.
@@ -569,7 +593,8 @@ declare function isFileFormatSupported(file: File, formats: readonly FileFormat[
569
593
  * Duplicate values are removed while their configuration order is retained.
570
594
  */
571
595
  declare function createUploadAccept(formats: readonly FileFormat[]): string;
572
-
596
+ //#endregion
597
+ //#region src/upload/upload.validation.d.ts
573
598
  /**
574
599
  * Validates one file against configured format and size constraints.
575
600
  * Returns the first stable error key or nothing for a valid file.
@@ -580,7 +605,8 @@ declare function validateUploadFile(file: File, formats: readonly FileFormat[],
580
605
  * Returns accepted entries and the final rejection key from the batch.
581
606
  */
582
607
  declare function validateUploadFiles(incomingFiles: readonly File[], options: UploadFilesValidationOptions): UploadFilesValidationResult;
583
-
608
+ //#endregion
609
+ //#region src/utilities/datetime.utilities.d.ts
584
610
  /**
585
611
  * Projects the current instant onto the wall-clock fields of another timezone.
586
612
  * The timezone defaults to `Europe/London` when no option is provided.
@@ -589,7 +615,7 @@ declare function validateUploadFiles(incomingFiles: readonly File[], options: Up
589
615
  * const londonTime = getZonedTime({ tz: 'Europe/London' });
590
616
  */
591
617
  declare function getZonedTime({ tz }?: {
592
- tz?: string;
618
+ tz?: string;
593
619
  }): Date;
594
620
  /**
595
621
  * Formats the UTC offset of a timezone at the supplied date.
@@ -607,7 +633,7 @@ declare function getUTCOffset(date: Date, tz: string): string;
607
633
  * getFormattedTime({ tz: 'Europe/Moscow' }); // `03:04:05 (+3 UTC)`
608
634
  */
609
635
  declare function getFormattedTime({ tz }?: {
610
- tz?: string;
636
+ tz?: string;
611
637
  }): string;
612
638
  /**
613
639
  * Formats the current date with optional time and UTC offset components.
@@ -616,9 +642,9 @@ declare function getFormattedTime({ tz }?: {
616
642
  * @example
617
643
  * getFormattedDate({ tz: 'UTC', withTime: false }); // `02.01.2024`
618
644
  */
619
- declare function getFormattedDate({ tz, withTime, }?: {
620
- tz?: string;
621
- withTime?: boolean;
645
+ declare function getFormattedDate({ tz, withTime }?: {
646
+ tz?: string;
647
+ withTime?: boolean;
622
648
  }): string;
623
649
  /**
624
650
  * Formats an explicit instant in another timezone using the selected locale.
@@ -628,10 +654,11 @@ declare function getFormattedDate({ tz, withTime, }?: {
628
654
  * formatTime(date, { locale: ru, tz: 'Europe/Moscow' });
629
655
  */
630
656
  declare function formatTime(time: Date, { locale, tz }?: {
631
- locale?: Locale;
632
- tz?: string;
657
+ locale?: Locale;
658
+ tz?: string;
633
659
  }): string;
634
-
660
+ //#endregion
661
+ //#region src/utilities/encoding.utilities.d.ts
635
662
  /**
636
663
  * Encodes arbitrary binary bytes into their canonical Base64 representation.
637
664
  * Chunked conversion avoids the argument limit imposed by `String.fromCharCode`.
@@ -642,7 +669,8 @@ declare function encodeBase64(bytes: Uint8Array): string;
642
669
  * Invalid input preserves the native `atob` failure instead of returning partial data.
643
670
  */
644
671
  declare function decodeBase64(value: string): Uint8Array<ArrayBuffer>;
645
-
672
+ //#endregion
673
+ //#region src/utilities/enums.utilities.d.ts
646
674
  /**
647
675
  * Recursively replaces dots in a string literal with underscores.
648
676
  * Every other character remains unchanged in the resulting literal type.
@@ -666,9 +694,7 @@ type ReplaceHyphensWithUnderscores<TValue extends string> = TValue extends `${in
666
694
  * @example
667
695
  * type Statuses = StringEnumRecord<readonly ['review.pending', 'published']>;
668
696
  */
669
- type StringEnumRecord<TValues extends readonly string[]> = Readonly<{
670
- [Value in TValues[number] as Uppercase<ReplaceHyphensWithUnderscores<ReplaceDotsWithUnderscores<Value>>>]: Value;
671
- }>;
697
+ type StringEnumRecord<TValues extends readonly string[]> = Readonly<{ [Value in TValues[number] as Uppercase<ReplaceHyphensWithUnderscores<ReplaceDotsWithUnderscores<Value>>>]: Value; }>;
672
698
  /**
673
699
  * Creates an immutable enum-like record from a readonly string array.
674
700
  * Keys are uppercased and every dot or hyphen is replaced with an underscore.
@@ -677,7 +703,8 @@ type StringEnumRecord<TValues extends readonly string[]> = Readonly<{
677
703
  * createStringEnumRecord(['foo-bar.s', 'baz'] as const); // `{ FOO_BAR_S: 'foo-bar.s', BAZ: 'baz' }`
678
704
  */
679
705
  declare function createStringEnumRecord<const T extends readonly string[]>(values: T): StringEnumRecord<T>;
680
-
706
+ //#endregion
707
+ //#region src/utilities/execution.utilities.d.ts
681
708
  /**
682
709
  * Resolves synchronous and asynchronous executions through one promise-based contract.
683
710
  * Failures use the supplied fallback or propagate unchanged when none is available.
@@ -691,16 +718,16 @@ declare function safeExecute<T, E = never>(fn: () => Promise<T> | T, onError?: (
691
718
  * The original value is preserved beside its rounded millisecond duration.
692
719
  */
693
720
  type MeasuredExecution<T> = {
694
- /**
695
- * Value resolved by the measured execution without cloning or transformation.
696
- * Its generic type remains identical to the original asynchronous result.
697
- */
698
- result: T;
699
- /**
700
- * Rounded wall-clock duration of the measured execution in milliseconds.
701
- * The value is always collected after the supplied promise resolves.
702
- */
703
- executionTime: number;
721
+ /**
722
+ * Value resolved by the measured execution without cloning or transformation.
723
+ * Its generic type remains identical to the original asynchronous result.
724
+ */
725
+ result: T;
726
+ /**
727
+ * Rounded wall-clock duration of the measured execution in milliseconds.
728
+ * The value is always collected after the supplied promise resolves.
729
+ */
730
+ executionTime: number;
704
731
  };
705
732
  /**
706
733
  * Measures an asynchronous execution while preserving its resolved result.
@@ -713,7 +740,8 @@ type MeasuredExecution<T> = {
713
740
  * console.log(`Execution time: ${executionTime}ms`);
714
741
  */
715
742
  declare function measureExecutionTime<T>(execution: () => Promise<T>): Promise<MeasuredExecution<T>>;
716
-
743
+ //#endregion
744
+ //#region src/utilities/generation.utilities.d.ts
717
745
  /**
718
746
  * Creates a cryptographically sourced string from the alphanumeric set.
719
747
  * Requested length defaults to `10` characters when omitted.
@@ -723,15 +751,15 @@ declare function measureExecutionTime<T>(execution: () => Promise<T>): Promise<M
723
751
  * generateRandomString(); // `G5kLm2P9sQ`
724
752
  */
725
753
  declare function generateRandomString(length?: number): string;
726
-
754
+ //#endregion
755
+ //#region src/utilities/type.utilities.d.ts
727
756
  /**
728
757
  * Utility type that simplifies a given type T by flattening its structure.
729
758
  * This is particularly useful for improving the readability of complex types.
730
759
  */
731
- type Simplify<T> = {
732
- [K in keyof T]: T[K];
733
- } & {};
734
-
760
+ type Simplify<T> = { [K in keyof T]: T[K]; } & {};
761
+ //#endregion
762
+ //#region src/zod-bulk/zod-bulk.schemas.d.ts
735
763
  /**
736
764
  * Builds a strict selection contract for bulk operations across paginated data.
737
765
  * The identifier schema is shared by explicit and all-matching selection modes.
@@ -744,150 +772,155 @@ type Simplify<T> = {
744
772
  * identifierSchema: z.string().min(1),
745
773
  * });
746
774
  */
747
- declare function zodBulkSelectionSchema<const TIdentifierSchema extends z.ZodType<string | number>>({ identifierSchema, }: {
748
- /**
749
- * Schema used to validate every included or excluded entity identifier.
750
- * Its transforms and exact inferred output are preserved in both branches.
751
- */
752
- identifierSchema: TIdentifierSchema;
753
- }): z.ZodDiscriminatedUnion<[z.ZodObject<{
754
- mode: z.ZodLiteral<"include">;
755
- identifiers: z.ZodArray<TIdentifierSchema>;
756
- }, z.core.$strict>, z.ZodObject<{
757
- mode: z.ZodLiteral<"exclude">;
758
- excludedIdentifiers: z.ZodArray<TIdentifierSchema>;
759
- }, z.core.$strict>], "mode">;
760
-
775
+ declare function zodBulkSelectionSchema<const TIdentifierSchema extends z$1.ZodType<string | number>>({ identifierSchema }: {
776
+ /**
777
+ * Schema used to validate every included or excluded entity identifier.
778
+ * Its transforms and exact inferred output are preserved in both branches.
779
+ */
780
+ identifierSchema: TIdentifierSchema;
781
+ }): z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
782
+ mode: z$1.ZodLiteral<"include">;
783
+ identifiers: z$1.ZodArray<TIdentifierSchema>;
784
+ }, z$1.core.$strict>, z$1.ZodObject<{
785
+ mode: z$1.ZodLiteral<"exclude">;
786
+ excludedIdentifiers: z$1.ZodArray<TIdentifierSchema>;
787
+ }, z$1.core.$strict>], "mode">;
788
+ //#endregion
789
+ //#region src/zod-bulk/zod-bulk.types.d.ts
761
790
  /**
762
791
  * Shared bulk-selection payload produced by `zodBulkSelectionSchema`.
763
792
  * String identifiers are used by default for frontend table integrations.
764
793
  */
765
- type ZodBulkSelection<TIdentifier extends string | number = string> = z$1.infer<ReturnType<typeof zodBulkSelectionSchema<z.ZodType<TIdentifier>>>>;
794
+ type ZodBulkSelection<TIdentifier extends string | number = string> = z.infer<ReturnType<typeof zodBulkSelectionSchema<z.ZodType<TIdentifier>>>>;
766
795
  /**
767
796
  * Explicit bulk selection containing only identifiers chosen by the client.
768
797
  * This branch does not require resolving an all-matching search snapshot.
769
798
  */
770
799
  type ZodBulkIncludeSelection<TIdentifier extends string | number = string> = Extract<ZodBulkSelection<TIdentifier>, {
771
- mode: 'include';
800
+ mode: 'include';
772
801
  }>;
773
802
  /**
774
803
  * All-matching bulk selection containing identifiers excluded by the client.
775
804
  * Backend handlers must resolve targets from the same search snapshot.
776
805
  */
777
806
  type ZodBulkExcludeSelection<TIdentifier extends string | number = string> = Extract<ZodBulkSelection<TIdentifier>, {
778
- mode: 'exclude';
807
+ mode: 'exclude';
779
808
  }>;
780
-
809
+ //#endregion
810
+ //#region src/zod-jwt/zod-jwt.types.d.ts
781
811
  /**
782
812
  * Configures the algorithm and default expiration used by `ZodJWTService`.
783
813
  * Omitted values fall back to `HS256` and fifteen minutes respectively.
784
814
  */
785
815
  type JWTServiceOptions = {
786
- /**
787
- * Symmetric algorithm used to sign and verify every token handled by the service.
788
- * Defaults to `HS256` when the configuration does not provide another value.
789
- */
790
- algorithm?: SymmetricAlgorithm;
791
- /**
792
- * Default lifetime assigned to signed tokens, expressed in seconds.
793
- * Defaults to `900` seconds, which is equivalent to fifteen minutes.
794
- */
795
- defaultExpirationSeconds?: number;
816
+ /**
817
+ * Symmetric algorithm used to sign and verify every token handled by the service.
818
+ * Defaults to `HS256` when the configuration does not provide another value.
819
+ */
820
+ algorithm?: SymmetricAlgorithm;
821
+ /**
822
+ * Default lifetime assigned to signed tokens, expressed in seconds.
823
+ * Defaults to `900` seconds, which is equivalent to fifteen minutes.
824
+ */
825
+ defaultExpirationSeconds?: number;
796
826
  };
797
827
  /**
798
828
  * Configures one JWT signing operation without changing service defaults.
799
829
  * A supplied expiration takes precedence over `defaultExpirationSeconds`.
800
830
  */
801
831
  type JWTSignOptions = {
802
- /**
803
- * Lifetime assigned to the token created by this signing operation.
804
- * Overrides the service default and remains expressed in seconds.
805
- */
806
- expiresInSeconds?: number;
832
+ /**
833
+ * Lifetime assigned to the token created by this signing operation.
834
+ * Overrides the service default and remains expressed in seconds.
835
+ */
836
+ expiresInSeconds?: number;
807
837
  };
808
838
  /**
809
839
  * Resolves the parsed payload of a Zod schema or preserves a direct payload type.
810
840
  * Schema transforms are reflected in the resulting inferred payload.
811
841
  */
812
- type Payload<T> = T extends z$1.ZodType ? z$1.infer<T> : T;
842
+ type Payload<T> = T extends z.ZodType ? z.infer<T> : T;
813
843
  /**
814
844
  * Preserves a Zod payload schema and rejects direct payload types with `never`.
815
845
  * The result controls whether runtime payload validation is available.
816
846
  */
817
- type PayloadSchema<T> = T extends z$1.ZodType ? T : never;
818
-
847
+ type PayloadSchema<T> = T extends z.ZodType ? T : never;
848
+ //#endregion
849
+ //#region src/zod-jwt/zod-jwt.services.d.ts
819
850
  /**
820
851
  * Signs, decodes, and verifies JWTs with optional Zod payload validation.
821
852
  * A supplied schema parses payloads returned by decoding and verification.
822
853
  */
823
854
  declare class ZodJWTService<TPayloadOrSchema> {
824
- readonly payloadSchema: PayloadSchema<TPayloadOrSchema> | undefined;
825
- protected readonly algorithm: SymmetricAlgorithm;
826
- protected readonly defaultExpirationSeconds: number;
827
- constructor(payloadSchema?: PayloadSchema<TPayloadOrSchema>, options?: JWTServiceOptions);
828
- /**
829
- * Signs a payload using the configured algorithm and expiration settings.
830
- * Per-call expiration overrides the default configured by the service.
831
- *
832
- * @example
833
- * const token = await jwtService.sign({ userId: '123' }, secret, { expiresInSeconds: 300 });
834
- */
835
- sign(payload: Payload<TPayloadOrSchema>, secret: string, options?: JWTSignOptions): Promise<string>;
836
- /**
837
- * Decodes without authenticating it and parses its payload when a schema exists.
838
- * Schema validation failures return `null`, while malformed tokens still reject.
839
- *
840
- * @example
841
- * const payload = await jwtService.decode(token);
842
- */
843
- decode(token: string): Promise<Payload<TPayloadOrSchema> | null>;
844
- /**
845
- * Verifies a token using the configured algorithm and parses its payload.
846
- * Signature, expiration, and schema validation failures reject the operation.
847
- *
848
- * @example
849
- * const payload = await jwtService.verifyOrThrow(token, secret);
850
- */
851
- verifyOrThrow(token: string, secret: string): Promise<Payload<TPayloadOrSchema>>;
855
+ readonly payloadSchema: PayloadSchema<TPayloadOrSchema> | undefined;
856
+ protected readonly algorithm: SymmetricAlgorithm;
857
+ protected readonly defaultExpirationSeconds: number;
858
+ constructor(payloadSchema?: PayloadSchema<TPayloadOrSchema>, options?: JWTServiceOptions);
859
+ /**
860
+ * Signs a payload using the configured algorithm and expiration settings.
861
+ * Per-call expiration overrides the default configured by the service.
862
+ *
863
+ * @example
864
+ * const token = await jwtService.sign({ userId: '123' }, secret, { expiresInSeconds: 300 });
865
+ */
866
+ sign(payload: Payload<TPayloadOrSchema>, secret: string, options?: JWTSignOptions): Promise<string>;
867
+ /**
868
+ * Decodes without authenticating it and parses its payload when a schema exists.
869
+ * Schema validation failures return `null`, while malformed tokens still reject.
870
+ *
871
+ * @example
872
+ * const payload = await jwtService.decode(token);
873
+ */
874
+ decode(token: string): Promise<Payload<TPayloadOrSchema> | null>;
875
+ /**
876
+ * Verifies a token using the configured algorithm and parses its payload.
877
+ * Signature, expiration, and schema validation failures reject the operation.
878
+ *
879
+ * @example
880
+ * const payload = await jwtService.verifyOrThrow(token, secret);
881
+ */
882
+ verifyOrThrow(token: string, secret: string): Promise<Payload<TPayloadOrSchema>>;
852
883
  }
853
-
884
+ //#endregion
885
+ //#region src/zod-search/zod-search.pagination.schemas.d.ts
854
886
  /**
855
887
  * Validates offset-based pagination shared by search request contracts.
856
888
  * Missing fields inside the required object receive predictable defaults.
857
889
  */
858
- declare const zodPaginationSchema: z.ZodObject<{
859
- offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
860
- limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
861
- }, z.core.$strip>;
890
+ declare const zodPaginationSchema: z$1.ZodObject<{
891
+ offset: z$1.ZodDefault<z$1.ZodCoercedNumber<unknown>>;
892
+ limit: z$1.ZodDefault<z$1.ZodCoercedNumber<unknown>>;
893
+ }, z$1.core.$strip>;
862
894
  /**
863
895
  * Exposes pagination fields for composition into other object schemas.
864
896
  * The shape stays derived from the schema to prevent contract divergence.
865
897
  */
866
898
  declare const zodPaginationShape: {
867
- offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
868
- limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
899
+ offset: z$1.ZodDefault<z$1.ZodCoercedNumber<unknown>>;
900
+ limit: z$1.ZodDefault<z$1.ZodCoercedNumber<unknown>>;
869
901
  };
870
-
902
+ //#endregion
903
+ //#region src/zod-search/zod-search.types.d.ts
871
904
  /**
872
905
  * TypeScript output produced after successful pagination validation.
873
906
  * Defaulted fields are represented as required numeric properties.
874
907
  */
875
- type ZodPaginationOptions = z$1.infer<typeof zodPaginationSchema>;
908
+ type ZodPaginationOptions = z.infer<typeof zodPaginationSchema>;
876
909
  /**
877
910
  * Feature flags shared by both supported search schema composition modes.
878
911
  * Literal values are preserved in the resulting runtime and static shapes.
879
912
  */
880
913
  type ZodSearchFeatureOptions<TQueryEnabled extends boolean, TPaginationEnabled extends boolean> = {
881
- /**
882
- * Controls whether an optional non-empty `query` field is generated.
883
- * The field is enabled when this option is omitted from the call.
884
- */
885
- queryEnabled?: TQueryEnabled;
886
- /**
887
- * Controls whether a required `pagination` object is generated.
888
- * The field is enabled when this option is omitted from the call.
889
- */
890
- paginationEnabled?: TPaginationEnabled;
914
+ /**
915
+ * Controls whether an optional non-empty `query` field is generated.
916
+ * The field is enabled when this option is omitted from the call.
917
+ */
918
+ queryEnabled?: TQueryEnabled;
919
+ /**
920
+ * Controls whether a required `pagination` object is generated.
921
+ * The field is enabled when this option is omitted from the call.
922
+ */
923
+ paginationEnabled?: TPaginationEnabled;
891
924
  };
892
925
  /**
893
926
  * Configuration used to compose a reusable search request schema.
@@ -896,34 +929,35 @@ type ZodSearchFeatureOptions<TQueryEnabled extends boolean, TPaginationEnabled e
896
929
  * `filters` is the concise mode that applies partial and non-empty rules.
897
930
  * `whereSchema` accepts a fully prepared schema with custom Zod effects.
898
931
  */
899
- type ZodSearchSchemaOptions<TShape extends z$1.ZodRawShape = never, TWhereSchema extends z$1.ZodType<Record<string, unknown>> = never, TQueryEnabled extends boolean = true, TPaginationEnabled extends boolean = true> = ZodSearchFeatureOptions<TQueryEnabled, TPaginationEnabled> & ({
900
- /**
901
- * Object schema whose fields become optional filters inside `where`.
902
- * The factory requires one defined value whenever `where` is present.
903
- */
904
- filters: z$1.ZodObject<TShape>;
905
- /** Prevents combining automatic filters with a prepared schema. */
906
- whereSchema?: never;
932
+ type ZodSearchSchemaOptions<TShape extends z.ZodRawShape = never, TWhereSchema extends z.ZodType<Record<string, unknown>> = never, TQueryEnabled extends boolean = true, TPaginationEnabled extends boolean = true> = ZodSearchFeatureOptions<TQueryEnabled, TPaginationEnabled> & ({
933
+ /**
934
+ * Object schema whose fields become optional filters inside `where`.
935
+ * The factory requires one defined value whenever `where` is present.
936
+ */
937
+ filters: z.ZodObject<TShape>;
938
+ /** Prevents combining automatic filters with a prepared schema. */
939
+ whereSchema?: never;
907
940
  } | {
908
- /** Prevents combining a prepared schema with automatic filters. */
909
- filters?: never;
910
- /**
911
- * Prepared schema used directly to validate the `where` object.
912
- * Its refinements, transforms, and inferred output are preserved.
913
- */
914
- whereSchema: TWhereSchema;
941
+ /** Prevents combining a prepared schema with automatic filters. */
942
+ filters?: never;
943
+ /**
944
+ * Prepared schema used directly to validate the `where` object.
945
+ * Its refinements, transforms, and inferred output are preserved.
946
+ */
947
+ whereSchema: TWhereSchema;
915
948
  });
916
-
949
+ //#endregion
950
+ //#region src/zod-search/zod-search.schemas.d.ts
917
951
  /**
918
952
  * Optional text query shared by search request contracts.
919
953
  * Provided values are trimmed and must contain visible text.
920
954
  */
921
- declare const zodSearchQuerySchema: z.ZodOptional<z.ZodString>;
955
+ declare const zodSearchQuerySchema: z$1.ZodOptional<z$1.ZodString>;
922
956
  /**
923
957
  * Makes every supplied filter optional while requiring one defined value.
924
958
  * Top-level optionality is added later for both composition modes equally.
925
959
  */
926
- declare const createZodSearchWhereSchema: <TShape extends z.ZodRawShape>(filters: z.ZodObject<TShape>) => z.ZodPipe<z.ZodObject<{ -readonly [k in keyof TShape]: z.ZodOptional<TShape[k]>; }, z.core.$strip>, z.ZodTransform<Awaited<AtLeastOne<z.core.$InferObjectOutput<{ -readonly [k in keyof TShape]: z.ZodOptional<TShape[k]>; }, {}>, keyof z.core.$InferObjectOutput<{ -readonly [k in keyof TShape]: z.ZodOptional<TShape[k]>; }, {}>>>, z.core.$InferObjectOutput<{ -readonly [k in keyof TShape]: z.ZodOptional<TShape[k]>; }, {}>>>;
960
+ declare const createZodSearchWhereSchema: <TShape extends z$1.ZodRawShape>(filters: z$1.ZodObject<TShape>) => z$1.ZodPipe<z$1.ZodObject<{ -readonly [k in keyof TShape]: z$1.ZodOptional<TShape[k]>; }, z$1.core.$strip>, z$1.ZodTransform<Awaited<AtLeastOne<z$1.core.$InferObjectOutput<{ -readonly [k in keyof TShape]: z$1.ZodOptional<TShape[k]>; }, {}>, keyof z$1.core.$InferObjectOutput<{ -readonly [k in keyof TShape]: z$1.ZodOptional<TShape[k]>; }, {}>>>, z$1.core.$InferObjectOutput<{ -readonly [k in keyof TShape]: z$1.ZodOptional<TShape[k]>; }, {}>>>;
927
961
  /**
928
962
  * Empty schema shape used when a search feature is explicitly disabled.
929
963
  * Intersections remove disabled fields without widening enabled branches.
@@ -933,19 +967,17 @@ type ZodDisabledSearchShape = Record<never, never>;
933
967
  * Resolves the schema used by `where` from the selected composition mode.
934
968
  * Prepared schemas remain untouched, including their effects and output.
935
969
  */
936
- type ZodSearchWhereSchema<TShape extends z.ZodRawShape, TWhereSchema extends z.ZodType<Record<string, unknown>>> = [
937
- TWhereSchema
938
- ] extends [never] ? ReturnType<typeof createZodSearchWhereSchema<TShape>> : TWhereSchema;
970
+ type ZodSearchWhereSchema<TShape extends z$1.ZodRawShape, TWhereSchema extends z$1.ZodType<Record<string, unknown>>> = [TWhereSchema] extends [never] ? ReturnType<typeof createZodSearchWhereSchema<TShape>> : TWhereSchema;
939
971
  /**
940
972
  * Schema-level shape assembled from the selected source and feature flags.
941
973
  * Keeping Zod schemas here makes runtime composition the contract source.
942
974
  */
943
- type ZodSearchShape<TShape extends z.ZodRawShape, TWhereSchema extends z.ZodType<Record<string, unknown>>, TQueryEnabled extends boolean, TPaginationEnabled extends boolean> = {
944
- where: z.ZodOptional<ZodSearchWhereSchema<TShape, TWhereSchema>>;
975
+ type ZodSearchShape<TShape extends z$1.ZodRawShape, TWhereSchema extends z$1.ZodType<Record<string, unknown>>, TQueryEnabled extends boolean, TPaginationEnabled extends boolean> = {
976
+ where: z$1.ZodOptional<ZodSearchWhereSchema<TShape, TWhereSchema>>;
945
977
  } & (TQueryEnabled extends false ? ZodDisabledSearchShape : {
946
- query: typeof zodSearchQuerySchema;
978
+ query: typeof zodSearchQuerySchema;
947
979
  }) & (TPaginationEnabled extends false ? ZodDisabledSearchShape : {
948
- pagination: typeof zodPaginationSchema;
980
+ pagination: typeof zodPaginationSchema;
949
981
  });
950
982
  /**
951
983
  * Builds a strict schema for reusable search request contracts.
@@ -966,16 +998,15 @@ type ZodSearchShape<TShape extends z.ZodRawShape, TWhereSchema extends z.ZodType
966
998
  * whereSchema: zodAtLeastOne(assetSchema.pick({ status: true }).partial()),
967
999
  * });
968
1000
  */
969
- declare const zodSearchSchema: <const TShape extends z.ZodRawShape = never, const TWhereSchema extends z.ZodType<Record<string, unknown>> = never, const TQueryEnabled extends boolean = true, const TPaginationEnabled extends boolean = true>(options: ZodSearchSchemaOptions<TShape, TWhereSchema, TQueryEnabled, TPaginationEnabled>) => z.ZodObject<ZodSearchShape<TShape, TWhereSchema, TQueryEnabled, TPaginationEnabled> extends infer T ? { -readonly [P in keyof T]: T[P]; } : never, z.core.$strict>;
970
-
1001
+ declare const zodSearchSchema: <const TShape extends z$1.ZodRawShape = never, const TWhereSchema extends z$1.ZodType<Record<string, unknown>> = never, const TQueryEnabled extends boolean = true, const TPaginationEnabled extends boolean = true>(options: ZodSearchSchemaOptions<TShape, TWhereSchema, TQueryEnabled, TPaginationEnabled>) => z$1.ZodObject<ZodSearchShape<TShape, TWhereSchema, TQueryEnabled, TPaginationEnabled> extends (infer T) ? { -readonly [P in keyof T]: T[P]; } : never, z$1.core.$strict>;
1002
+ //#endregion
1003
+ //#region src/zod-validation/zod-validation.types.d.ts
971
1004
  type StringifiablePayloadValue = string | number | boolean | bigint | Date;
972
1005
  /**
973
1006
  * Recursively transforms payload values to strings while preserving container structure.
974
1007
  * Nullable and omitted members remain unchanged for transport-layer omission handling.
975
1008
  */
976
- type StringifiedPayload<TValue> = TValue extends null | undefined ? TValue : TValue extends StringifiablePayloadValue ? string : TValue extends readonly (infer TItem)[] ? StringifiedPayload<TItem>[] : TValue extends object ? {
977
- [TKey in keyof TValue]: StringifiedPayload<TValue[TKey]>;
978
- } : string;
1009
+ type StringifiedPayload<TValue> = TValue extends null | undefined ? TValue : TValue extends StringifiablePayloadValue ? string : TValue extends readonly (infer TItem)[] ? StringifiedPayload<TItem>[] : TValue extends object ? { [TKey in keyof TValue]: StringifiedPayload<TValue[TKey]>; } : string;
979
1010
  /**
980
1011
  * Utility type that ensures at least one property from the specified
981
1012
  * keys of a given type T is required, while the rest remain optional.
@@ -989,7 +1020,8 @@ type StringifiedPayload<TValue> = TValue extends null | undefined ? TValue : TVa
989
1020
  * // Invalid: {}, { a: undefined, b: undefined, c: undefined }
990
1021
  */
991
1022
  type AtLeastOne<T, Keys extends keyof T = keyof T> = Keys extends keyof T ? Simplify<Required<Pick<T, Keys>> & Partial<Omit<T, Keys>>> : never;
992
-
1023
+ //#endregion
1024
+ //#region src/zod-validation/zod-validation.refiners.d.ts
993
1025
  /**
994
1026
  * Wraps a partial Zod object schema with:
995
1027
  * 1. A runtime check ensuring at least one field is non-undefined.
@@ -999,8 +1031,9 @@ type AtLeastOne<T, Keys extends keyof T = keyof T> = Keys extends keyof T ? Simp
999
1031
  * @example
1000
1032
  * zQuery(zodAtLeastOne(userSelectSchema)) // result: UserSelect ✓
1001
1033
  */
1002
- declare const zodAtLeastOne: <T extends ZodObject<ZodRawShape>>(schema: T) => z.ZodPipe<T, z.ZodTransform<Awaited<AtLeastOne<z.core.output<T>>>, z.core.output<T>>>;
1003
-
1034
+ declare const zodAtLeastOne: <T extends ZodObject<ZodRawShape>>(schema: T) => z$1.ZodPipe<T, z$1.ZodTransform<Awaited<AtLeastOne<z$1.TypeOf<T>>>, z$1.TypeOf<T>>>;
1035
+ //#endregion
1036
+ //#region src/zod-validation/zod-validation.parsing.d.ts
1004
1037
  declare const parseQueryValue: (value: unknown) => unknown;
1005
1038
  /**
1006
1039
  * Preprocesses query-like values before Zod validation.
@@ -1018,7 +1051,7 @@ declare const parseQueryValue: (value: unknown) => unknown;
1018
1051
  * schema.parse({ page: '2', isActive: 'true' });
1019
1052
  * // { page: 2, isActive: true }
1020
1053
  */
1021
- declare const asQuery: <T extends z.ZodTypeAny>(schema: T) => z.ZodPreprocess<T>;
1054
+ declare const asQuery: <T extends z$1.ZodTypeAny>(schema: T) => z$1.ZodPreprocess<T>;
1022
1055
  /**
1023
1056
  * Recursively converts payload values to strings without changing container structure.
1024
1057
  * Objects and arrays are copied while `null` and `undefined` retain omission semantics.
@@ -1028,11 +1061,12 @@ declare const asQuery: <T extends z.ZodTypeAny>(schema: T) => z.ZodPreprocess<T>
1028
1061
  * // { page: '2', enabled: 'true' }
1029
1062
  */
1030
1063
  declare function stringifyPayloadValues<TValue>(value: TValue): StringifiedPayload<TValue>;
1031
-
1064
+ //#endregion
1065
+ //#region src/zod-validation/zod-validation.utilities.d.ts
1032
1066
  /**
1033
1067
  * Checks whether a value is a plain record backed by `Object.prototype`.
1034
1068
  * Arrays, null, dates, collections, and custom class instances are rejected.
1035
1069
  */
1036
1070
  declare const isPlainObject: (value: unknown) => value is Record<string, unknown>;
1037
-
1038
- export { type APIContractData, type APIContractError, type APIContractResult, type APIError, type APISuccess, type AtLeastOne, DEFAULT_HMAC_ALGORITHM, DEFAULT_HMAC_ENCODING, DEFAULT_UPLOAD_MAX_FILE_SIZE, EXCEPTION_STATUS_CODES, type ExceptionStatusCode, type FetchResult, type FileFormat, type FileFormatConfig, type HMACAlgorithm, type HMACEncoding, type HMACInput, HMACService, type HMACServiceOptions, type HonoFileRespondOptions, type HonoRespondOptions, type JWTServiceOptions, type JWTSignOptions, type LogLevel, type MeasuredExecution, type Payload, type PayloadSchema, REDACTED_LOG_VALUE, type ReplaceDotsWithUnderscores, type ReplaceHyphensWithUnderscores, SUCCESS_STATUS_CODES, type Simplify, type StringEnumRecord, type StringifiedPayload, type SuccessStatusCode, type UploadFilesValidationOptions, type UploadFilesValidationResult, type UploadPreset, type UploadValidationError, type ZodBulkExcludeSelection, type ZodBulkIncludeSelection, type ZodBulkSelection, ZodJWTService, type ZodPaginationOptions, type ZodSearchSchemaOptions, type ZodUploadFileSchemaOptions, asQuery, createStringEnumRecord, createUploadAccept, createZodSearchWhereSchema, decodeBase64, decodeHMACSignature, defineUploadPreset, documentUploadPreset, encodeBase64, encodeHMACSignature, failure, fetchAndThrow, fetchSafely, fileFormat, fileFormatsArray, fileFormatsConfig, fileFormatsRecord, fileRespond, formatTime, generateRandomString, getColoredHTTPStatus, getFileExtension, getFormattedDate, getFormattedTime, getUTCOffset, getZonedTime, hmacAlgorithm, hmacAlgorithmsArray, hmacAlgorithmsRecord, hmacEncoding, hmacEncodingsArray, hmacEncodingsRecord, httpStatusColors, imageTransparentUploadPreset, imageUploadPreset, isFileExtensionSupported, isFileFormatSupported, isFileMimeTypeSupported, isPlainObject, log, logLevel, logLevelColors, logLevelsArray, logLevelsRecord, loggingMiddleware, matchesMimeType, measureExecutionTime, normalizeFileExtension, onHandlerError, parseQueryValue, redactSensitiveJSON, redactSensitiveSearchParams, respond, safeExecute, sensitiveLogKeyParts, sqlWhere, stringifyPayloadValues, success, toHMACBytes, uploadValidationError, uploadValidationErrorsArray, uploadValidationErrorsRecord, validateUploadFile, validateUploadFiles, zodAtLeastOne, zodBulkSelectionSchema, zodPaginationSchema, zodPaginationShape, zodSearchQuerySchema, zodSearchSchema, zodUploadFileSchema };
1071
+ //#endregion
1072
+ export { APIContractData, APIContractError, APIContractResult, APIError, APISuccess, AtLeastOne, DEFAULT_HMAC_ALGORITHM, DEFAULT_HMAC_ENCODING, DEFAULT_UPLOAD_MAX_FILE_SIZE, EXCEPTION_STATUS_CODES, ExceptionStatusCode, FetchResult, FileFormat, FileFormatConfig, HMACAlgorithm, HMACEncoding, HMACInput, HMACService, HMACServiceOptions, HonoFileRespondOptions, HonoRespondOptions, JWTServiceOptions, JWTSignOptions, LogLevel, MeasuredExecution, Payload, PayloadSchema, REDACTED_LOG_VALUE, ReplaceDotsWithUnderscores, ReplaceHyphensWithUnderscores, SUCCESS_STATUS_CODES, Simplify, StringEnumRecord, StringifiedPayload, SuccessStatusCode, UploadFilesValidationOptions, UploadFilesValidationResult, UploadPreset, UploadValidationError, ZodBulkExcludeSelection, ZodBulkIncludeSelection, ZodBulkSelection, ZodJWTService, ZodPaginationOptions, ZodSearchSchemaOptions, ZodUploadFileSchemaOptions, asQuery, createStringEnumRecord, createUploadAccept, createZodSearchWhereSchema, decodeBase64, decodeHMACSignature, defineUploadPreset, documentUploadPreset, encodeBase64, encodeHMACSignature, failure, fetchAndThrow, fetchSafely, fileFormat, fileFormatsArray, fileFormatsConfig, fileFormatsRecord, fileRespond, formatTime, generateRandomString, getColoredHTTPStatus, getFileExtension, getFormattedDate, getFormattedTime, getUTCOffset, getZonedTime, hmacAlgorithm, hmacAlgorithmsArray, hmacAlgorithmsRecord, hmacEncoding, hmacEncodingsArray, hmacEncodingsRecord, httpStatusColors, imageTransparentUploadPreset, imageUploadPreset, isFileExtensionSupported, isFileFormatSupported, isFileMimeTypeSupported, isPlainObject, log, logLevel, logLevelColors, logLevelsArray, logLevelsRecord, loggingMiddleware, matchesMimeType, measureExecutionTime, normalizeFileExtension, onHandlerError, parseQueryValue, redactSensitiveJSON, redactSensitiveSearchParams, respond, safeExecute, sensitiveLogKeyParts, sqlWhere, stringifyPayloadValues, success, toHMACBytes, uploadValidationError, uploadValidationErrorsArray, uploadValidationErrorsRecord, validateUploadFile, validateUploadFiles, zodAtLeastOne, zodBulkSelectionSchema, zodPaginationSchema, zodPaginationShape, zodSearchQuerySchema, zodSearchSchema, zodUploadFileSchema };