@cosmneo/onion-lasagna 0.1.0

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 (97) hide show
  1. package/dist/backend/core/global.cjs +283 -0
  2. package/dist/backend/core/global.cjs.map +1 -0
  3. package/dist/backend/core/global.d.cts +294 -0
  4. package/dist/backend/core/global.d.ts +294 -0
  5. package/dist/backend/core/global.js +39 -0
  6. package/dist/backend/core/global.js.map +1 -0
  7. package/dist/backend/core/onion-layers.cjs +2302 -0
  8. package/dist/backend/core/onion-layers.cjs.map +1 -0
  9. package/dist/backend/core/onion-layers.d.cts +1675 -0
  10. package/dist/backend/core/onion-layers.d.ts +1675 -0
  11. package/dist/backend/core/onion-layers.js +1158 -0
  12. package/dist/backend/core/onion-layers.js.map +1 -0
  13. package/dist/backend/core/presentation.cjs +573 -0
  14. package/dist/backend/core/presentation.cjs.map +1 -0
  15. package/dist/backend/core/presentation.d.cts +5 -0
  16. package/dist/backend/core/presentation.d.ts +5 -0
  17. package/dist/backend/core/presentation.js +28 -0
  18. package/dist/backend/core/presentation.js.map +1 -0
  19. package/dist/backend/core/validators/arktype.cjs +947 -0
  20. package/dist/backend/core/validators/arktype.cjs.map +1 -0
  21. package/dist/backend/core/validators/arktype.d.cts +188 -0
  22. package/dist/backend/core/validators/arktype.d.ts +188 -0
  23. package/dist/backend/core/validators/arktype.js +287 -0
  24. package/dist/backend/core/validators/arktype.js.map +1 -0
  25. package/dist/backend/core/validators/typebox.cjs +939 -0
  26. package/dist/backend/core/validators/typebox.cjs.map +1 -0
  27. package/dist/backend/core/validators/typebox.d.cts +189 -0
  28. package/dist/backend/core/validators/typebox.d.ts +189 -0
  29. package/dist/backend/core/validators/typebox.js +281 -0
  30. package/dist/backend/core/validators/typebox.js.map +1 -0
  31. package/dist/backend/core/validators/valibot.cjs +942 -0
  32. package/dist/backend/core/validators/valibot.cjs.map +1 -0
  33. package/dist/backend/core/validators/valibot.d.cts +160 -0
  34. package/dist/backend/core/validators/valibot.d.ts +160 -0
  35. package/dist/backend/core/validators/valibot.js +294 -0
  36. package/dist/backend/core/validators/valibot.js.map +1 -0
  37. package/dist/backend/core/validators/zod.cjs +934 -0
  38. package/dist/backend/core/validators/zod.cjs.map +1 -0
  39. package/dist/backend/core/validators/zod.d.cts +188 -0
  40. package/dist/backend/core/validators/zod.d.ts +188 -0
  41. package/dist/backend/core/validators/zod.js +278 -0
  42. package/dist/backend/core/validators/zod.js.map +1 -0
  43. package/dist/backend/frameworks/elysia.cjs +715 -0
  44. package/dist/backend/frameworks/elysia.cjs.map +1 -0
  45. package/dist/backend/frameworks/elysia.d.cts +208 -0
  46. package/dist/backend/frameworks/elysia.d.ts +208 -0
  47. package/dist/backend/frameworks/elysia.js +251 -0
  48. package/dist/backend/frameworks/elysia.js.map +1 -0
  49. package/dist/backend/frameworks/fastify.cjs +677 -0
  50. package/dist/backend/frameworks/fastify.cjs.map +1 -0
  51. package/dist/backend/frameworks/fastify.d.cts +201 -0
  52. package/dist/backend/frameworks/fastify.d.ts +201 -0
  53. package/dist/backend/frameworks/fastify.js +213 -0
  54. package/dist/backend/frameworks/fastify.js.map +1 -0
  55. package/dist/backend/frameworks/hono.cjs +715 -0
  56. package/dist/backend/frameworks/hono.cjs.map +1 -0
  57. package/dist/backend/frameworks/hono.d.cts +163 -0
  58. package/dist/backend/frameworks/hono.d.ts +163 -0
  59. package/dist/backend/frameworks/hono.js +249 -0
  60. package/dist/backend/frameworks/hono.js.map +1 -0
  61. package/dist/backend/frameworks/nestjs.cjs +260 -0
  62. package/dist/backend/frameworks/nestjs.cjs.map +1 -0
  63. package/dist/backend/frameworks/nestjs.d.cts +168 -0
  64. package/dist/backend/frameworks/nestjs.d.ts +168 -0
  65. package/dist/backend/frameworks/nestjs.js +193 -0
  66. package/dist/backend/frameworks/nestjs.js.map +1 -0
  67. package/dist/base-dto.class-D7W9iqoU.d.cts +146 -0
  68. package/dist/base-dto.class-D7W9iqoU.d.ts +146 -0
  69. package/dist/base-uuid-v7.vo-BPGEIWLM.d.ts +799 -0
  70. package/dist/base-uuid-v7.vo-BjqKX44G.d.cts +799 -0
  71. package/dist/chunk-74IKUOSE.js +116 -0
  72. package/dist/chunk-74IKUOSE.js.map +1 -0
  73. package/dist/chunk-BKZOLGQW.js +29 -0
  74. package/dist/chunk-BKZOLGQW.js.map +1 -0
  75. package/dist/chunk-CGZBV6BD.js +54 -0
  76. package/dist/chunk-CGZBV6BD.js.map +1 -0
  77. package/dist/chunk-DDAHJZVK.js +258 -0
  78. package/dist/chunk-DDAHJZVK.js.map +1 -0
  79. package/dist/chunk-MQD5GXMT.js +171 -0
  80. package/dist/chunk-MQD5GXMT.js.map +1 -0
  81. package/dist/chunk-OKFXZHBC.js +43 -0
  82. package/dist/chunk-OKFXZHBC.js.map +1 -0
  83. package/dist/chunk-RLLWYFPI.js +168 -0
  84. package/dist/chunk-RLLWYFPI.js.map +1 -0
  85. package/dist/chunk-VCHFXT5W.js +425 -0
  86. package/dist/chunk-VCHFXT5W.js.map +1 -0
  87. package/dist/chunk-ZWLYNGO3.js +40 -0
  88. package/dist/chunk-ZWLYNGO3.js.map +1 -0
  89. package/dist/http-response-BAhi8lF4.d.cts +124 -0
  90. package/dist/http-response-BAhi8lF4.d.ts +124 -0
  91. package/dist/index-DingXh7B.d.cts +1187 -0
  92. package/dist/index-tOH7XBa3.d.ts +1187 -0
  93. package/dist/routing.type-DB4pt-d9.d.ts +184 -0
  94. package/dist/routing.type-DF2BIL7x.d.cts +184 -0
  95. package/dist/validation-error.type-kD4_qNZ9.d.cts +199 -0
  96. package/dist/validation-error.type-kD4_qNZ9.d.ts +199 -0
  97. package/package.json +191 -0
@@ -0,0 +1,799 @@
1
+ import { a as BoundValidator } from './base-dto.class-D7W9iqoU.js';
2
+
3
+ /**
4
+ * Sentinel value to skip validation in Value Object constructors.
5
+ *
6
+ * Use this when creating a Value Object from already-validated data,
7
+ * such as when reconstituting from a database or creating derived VOs.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * // In a VO that wraps a validated value
12
+ * class Email extends BaseValueObject<string> {
13
+ * private constructor(value: string, validator: BoundValidator<string> | SkipValueObjectValidation) {
14
+ * super(value, validator);
15
+ * }
16
+ *
17
+ * // Public factory validates
18
+ * static create(value: string): Email {
19
+ * return new Email(value, emailValidator);
20
+ * }
21
+ *
22
+ * // Internal factory skips validation (data already validated)
23
+ * static fromPersistence(value: string): Email {
24
+ * return new Email(value, SKIP_VALUE_OBJECT_VALIDATION);
25
+ * }
26
+ * }
27
+ * ```
28
+ */
29
+ declare const SKIP_VALUE_OBJECT_VALIDATION: "skip value object validation";
30
+ /** Type for the skip validation sentinel. */
31
+ type SkipValueObjectValidation = typeof SKIP_VALUE_OBJECT_VALIDATION;
32
+ /**
33
+ * Base class for Domain-Driven Design Value Objects.
34
+ *
35
+ * Value Objects are immutable domain primitives that are compared by value,
36
+ * not by reference. They encapsulate validation and domain logic for
37
+ * primitive concepts like Email, Money, Address, etc.
38
+ *
39
+ * Key characteristics:
40
+ * - **Immutable**: Value cannot be changed after construction
41
+ * - **Equality by value**: Two VOs with the same value are considered equal
42
+ * - **Self-validating**: Validation runs at construction time
43
+ *
44
+ * @typeParam T - The underlying value type
45
+ *
46
+ * @example
47
+ * ```typescript
48
+ * class Email extends BaseValueObject<string> {
49
+ * private constructor(value: string, validator: BoundValidator<string> | SkipValueObjectValidation) {
50
+ * super(value, validator);
51
+ * }
52
+ *
53
+ * static create(value: string): Email {
54
+ * return new Email(value, emailValidator);
55
+ * }
56
+ *
57
+ * get domain(): string {
58
+ * return this.value.split('@')[1];
59
+ * }
60
+ * }
61
+ *
62
+ * const email1 = Email.create('user@example.com');
63
+ * const email2 = Email.create('user@example.com');
64
+ * email1.equals(email2); // true
65
+ * ```
66
+ */
67
+ declare class BaseValueObject<T> {
68
+ private readonly _value;
69
+ /**
70
+ * Creates a new Value Object instance.
71
+ *
72
+ * @param value - The raw value to wrap
73
+ * @param validator - A bound validator or SKIP_VALUE_OBJECT_VALIDATION to bypass
74
+ * @throws {ObjectValidationError} When validation fails
75
+ */
76
+ protected constructor(value: T, validator: BoundValidator<T> | typeof SKIP_VALUE_OBJECT_VALIDATION);
77
+ /**
78
+ * Compares this Value Object with another for equality.
79
+ *
80
+ * Uses deep equality comparison to handle nested objects, arrays, and dates.
81
+ * Two Value Objects are equal if their underlying values are deeply equal.
82
+ *
83
+ * @param other - The Value Object to compare with
84
+ * @returns `true` if the values are deeply equal, `false` otherwise
85
+ */
86
+ equals(other: BaseValueObject<T>): boolean;
87
+ /**
88
+ * The underlying immutable value.
89
+ *
90
+ * @returns The wrapped value of type T
91
+ */
92
+ get value(): T;
93
+ }
94
+
95
+ /**
96
+ * Base UUID v4 value object for random entity identifiers.
97
+ *
98
+ * UUID v4 is a randomly generated UUID, suitable for identifiers where
99
+ * time-ordering is not required. For time-sortable IDs, use {@link BaseUuidV7Vo}.
100
+ *
101
+ * **Use Cases:**
102
+ * - User IDs (for audit tracking)
103
+ * - Session tokens
104
+ * - Correlation IDs
105
+ * - Any identifier where time-ordering doesn't matter
106
+ *
107
+ * @example Generating a new ID
108
+ * ```typescript
109
+ * const id = BaseUuidV4Vo.generate();
110
+ * console.log(id.value); // e.g., "550e8400-e29b-41d4-a716-446655440000"
111
+ * ```
112
+ *
113
+ * @example Extending for validation
114
+ * ```typescript
115
+ * class UserIdVo extends BaseUuidV4Vo {
116
+ * static create(value: string): UserIdVo {
117
+ * return new UserIdVo(value, uuidValidator);
118
+ * }
119
+ *
120
+ * static generate(): UserIdVo {
121
+ * return new UserIdVo(v4(), SKIP_VALUE_OBJECT_VALIDATION);
122
+ * }
123
+ * }
124
+ * ```
125
+ */
126
+
127
+ /**
128
+ * Value object for UUID v4 identifiers.
129
+ *
130
+ * Provides a `generate()` factory method that creates new random UUIDs.
131
+ *
132
+ * @extends BaseValueObject<string>
133
+ */
134
+ declare class BaseUuidV4Vo extends BaseValueObject<string> {
135
+ /**
136
+ * Creates a new BaseUuidV4Vo instance.
137
+ *
138
+ * @param value - The UUID v4 string value
139
+ * @param validator - Bound validator or skip validation symbol
140
+ */
141
+ protected constructor(value: string, validator: BoundValidator<string> | typeof SKIP_VALUE_OBJECT_VALIDATION);
142
+ /**
143
+ * Generates a new UUID v4 value object.
144
+ *
145
+ * Creates a random UUID, skipping validation since the
146
+ * `uuid` library guarantees format.
147
+ *
148
+ * @returns A new BaseUuidV4Vo with a freshly generated UUID
149
+ */
150
+ static generate(): BaseUuidV4Vo;
151
+ /**
152
+ * Creates a UUID v4 value object from an existing string.
153
+ *
154
+ * **Important:** This base implementation skips validation and accepts
155
+ * any string value. Subclasses should override this method with a
156
+ * validator to ensure UUID format correctness.
157
+ *
158
+ * @param value - The UUID v4 string value (not validated at base level)
159
+ * @returns A new BaseUuidV4Vo with the provided value
160
+ *
161
+ * @example Subclass with validation (recommended)
162
+ * ```typescript
163
+ * class UserId extends BaseUuidV4Vo {
164
+ * static override create(value: string): UserId {
165
+ * return new UserId(value, uuidV4Validator);
166
+ * }
167
+ * }
168
+ * ```
169
+ *
170
+ * @see generate - For creating new UUIDs (always valid)
171
+ */
172
+ static create(value: string): BaseUuidV4Vo;
173
+ }
174
+
175
+ /**
176
+ * Base audit user tracking value object.
177
+ *
178
+ * Tracks which user created and last updated an entity. User IDs are
179
+ * optional to support system-initiated operations where no user context
180
+ * is available.
181
+ *
182
+ * @example Extending for a validator-specific implementation
183
+ * ```typescript
184
+ * class AuditByVo extends BaseAuditByVo {
185
+ * static create(opts?: {
186
+ * createdBy?: UuidV4Vo;
187
+ * updatedBy?: UuidV4Vo;
188
+ * }): AuditByVo {
189
+ * return new AuditByVo({
190
+ * createdBy: opts?.createdBy,
191
+ * updatedBy: opts?.updatedBy ?? opts?.createdBy,
192
+ * }, SKIP_VALUE_OBJECT_VALIDATION);
193
+ * }
194
+ *
195
+ * update(updatedBy: UuidV4Vo): AuditByVo {
196
+ * return new AuditByVo({
197
+ * createdBy: this.createdBy,
198
+ * updatedBy,
199
+ * }, SKIP_VALUE_OBJECT_VALIDATION);
200
+ * }
201
+ * }
202
+ * ```
203
+ */
204
+
205
+ /**
206
+ * Abstract base class for audit user tracking value objects.
207
+ *
208
+ * @extends BaseValueObject
209
+ */
210
+ declare abstract class BaseAuditByVo extends BaseValueObject<{
211
+ createdBy?: BaseUuidV4Vo;
212
+ updatedBy?: BaseUuidV4Vo;
213
+ }> {
214
+ /**
215
+ * Creates a new BaseAuditByVo instance.
216
+ *
217
+ * @param value - The user tracking values
218
+ * @param value.createdBy - User who created the entity (optional for system ops)
219
+ * @param value.updatedBy - User who last updated the entity (optional)
220
+ * @param validator - Bound validator or skip validation symbol
221
+ */
222
+ protected constructor(value: {
223
+ createdBy?: BaseUuidV4Vo;
224
+ updatedBy?: BaseUuidV4Vo;
225
+ }, validator: BoundValidator<{
226
+ createdBy?: BaseUuidV4Vo;
227
+ updatedBy?: BaseUuidV4Vo;
228
+ }> | SkipValueObjectValidation);
229
+ /**
230
+ * Creates a new audit user tracking with updated user ID.
231
+ *
232
+ * @param updatedBy - The user ID performing the update
233
+ * @returns A new immutable audit user tracking instance
234
+ */
235
+ abstract update(updatedBy: BaseUuidV4Vo): BaseAuditByVo;
236
+ /**
237
+ * The user ID who created the entity.
238
+ * Returns `undefined` for system-created entities.
239
+ */
240
+ get createdBy(): BaseUuidV4Vo | undefined;
241
+ /**
242
+ * The user ID who last updated the entity.
243
+ * Returns `undefined` for system-updated entities.
244
+ */
245
+ get updatedBy(): BaseUuidV4Vo | undefined;
246
+ }
247
+
248
+ /**
249
+ * Base audit timestamp value object.
250
+ *
251
+ * Tracks when an entity was created and last updated. Enforces the
252
+ * domain invariant that `updatedAt` cannot be earlier than `createdAt`.
253
+ *
254
+ * **Domain Invariant:**
255
+ * The constructor throws {@link InvariantViolationError} if
256
+ * `updatedAt < createdAt`, ensuring timestamps are always valid.
257
+ *
258
+ * **Immutability:**
259
+ * Date getters return cloned Date objects to prevent external mutation.
260
+ *
261
+ * @example Extending for a validator-specific implementation
262
+ * ```typescript
263
+ * class AuditOnVo extends BaseAuditOnVo {
264
+ * static create(opts?: { createdAt?: Date; updatedAt?: Date }): AuditOnVo {
265
+ * const now = new Date();
266
+ * return new AuditOnVo({
267
+ * createdAt: opts?.createdAt ?? now,
268
+ * updatedAt: opts?.updatedAt ?? now,
269
+ * }, SKIP_VALUE_OBJECT_VALIDATION);
270
+ * }
271
+ *
272
+ * update(): AuditOnVo {
273
+ * return new AuditOnVo({
274
+ * createdAt: this.createdAt,
275
+ * updatedAt: new Date(),
276
+ * }, SKIP_VALUE_OBJECT_VALIDATION);
277
+ * }
278
+ * }
279
+ * ```
280
+ */
281
+
282
+ /**
283
+ * Abstract base class for audit timestamp value objects.
284
+ *
285
+ * @extends BaseValueObject
286
+ * @throws {InvariantViolationError} When `updatedAt` is earlier than `createdAt`
287
+ */
288
+ declare abstract class BaseAuditOnVo extends BaseValueObject<{
289
+ createdAt: Date;
290
+ updatedAt: Date;
291
+ }> {
292
+ /**
293
+ * Creates a new BaseAuditOnVo instance.
294
+ *
295
+ * @param value - The timestamp values
296
+ * @param value.createdAt - When the entity was created
297
+ * @param value.updatedAt - When the entity was last updated
298
+ * @param validator - Bound validator or skip validation symbol
299
+ * @throws {InvariantViolationError} When `updatedAt < createdAt`
300
+ */
301
+ protected constructor(value: {
302
+ createdAt: Date;
303
+ updatedAt: Date;
304
+ }, validator: BoundValidator<{
305
+ createdAt: Date;
306
+ updatedAt: Date;
307
+ }> | SkipValueObjectValidation);
308
+ /**
309
+ * Creates a new audit timestamp with current time as updatedAt.
310
+ *
311
+ * @returns A new immutable audit timestamp instance
312
+ */
313
+ abstract update(): BaseAuditOnVo;
314
+ /**
315
+ * When the entity was created.
316
+ * Returns a cloned Date to prevent mutation.
317
+ */
318
+ get createdAt(): Date;
319
+ /**
320
+ * When the entity was last updated.
321
+ * Returns a cloned Date to prevent mutation.
322
+ */
323
+ get updatedAt(): Date;
324
+ }
325
+
326
+ /**
327
+ * Base audit info value object for entity tracking.
328
+ *
329
+ * Composite value object that combines timestamp tracking ({@link BaseAuditOnVo})
330
+ * and user tracking ({@link BaseAuditByVo}) into a single immutable audit record.
331
+ * Used for tracking entity creation and modification history.
332
+ *
333
+ * **Composition:**
334
+ * - `on`: {@link BaseAuditOnVo} - timestamps (createdAt, updatedAt)
335
+ * - `by`: {@link BaseAuditByVo} - user IDs (createdBy, updatedBy)
336
+ *
337
+ * **Immutability:**
338
+ * Date getters return cloned Date objects to prevent external mutation.
339
+ *
340
+ * @example Extending for a validator-specific implementation
341
+ * ```typescript
342
+ * class AuditInfoVo extends BaseAuditInfoVo {
343
+ * static create(createdBy?: UuidV4Vo): AuditInfoVo {
344
+ * const now = new Date();
345
+ * return new AuditInfoVo({
346
+ * by: AuditByVo.create({ createdBy, updatedBy: createdBy }),
347
+ * on: AuditOnVo.create({ createdAt: now, updatedAt: now }),
348
+ * }, SKIP_VALUE_OBJECT_VALIDATION);
349
+ * }
350
+ *
351
+ * update(updatedBy: UuidV4Vo): AuditInfoVo {
352
+ * return new AuditInfoVo({
353
+ * by: this.value.by.update(updatedBy),
354
+ * on: this.value.on.update(),
355
+ * }, SKIP_VALUE_OBJECT_VALIDATION);
356
+ * }
357
+ * }
358
+ * ```
359
+ *
360
+ * @example Using with an entity
361
+ * ```typescript
362
+ * class User {
363
+ * constructor(
364
+ * public readonly id: UuidV7Vo,
365
+ * public readonly name: string,
366
+ * public readonly audit: AuditInfoVo,
367
+ * ) {}
368
+ *
369
+ * updateName(name: string, updatedBy: UuidV4Vo): User {
370
+ * return new User(this.id, name, this.audit.update(updatedBy));
371
+ * }
372
+ * }
373
+ * ```
374
+ */
375
+
376
+ /**
377
+ * Abstract base class for audit information value objects.
378
+ *
379
+ * Extend this class and implement the `update()` method with your
380
+ * validator-specific child VOs.
381
+ *
382
+ * @extends BaseValueObject
383
+ */
384
+ declare abstract class BaseAuditInfoVo extends BaseValueObject<{
385
+ by: BaseAuditByVo;
386
+ on: BaseAuditOnVo;
387
+ }> {
388
+ /**
389
+ * Creates a new BaseAuditInfoVo instance.
390
+ *
391
+ * @param value - Composite value containing audit by and on VOs
392
+ * @param value.by - User tracking value object
393
+ * @param value.on - Timestamp tracking value object
394
+ * @param validator - Bound validator or skip validation symbol
395
+ */
396
+ protected constructor(value: {
397
+ by: BaseAuditByVo;
398
+ on: BaseAuditOnVo;
399
+ }, validator: BoundValidator<{
400
+ by: BaseAuditByVo;
401
+ on: BaseAuditOnVo;
402
+ }> | SkipValueObjectValidation);
403
+ /**
404
+ * Creates a new audit info with updated timestamp and user.
405
+ *
406
+ * @param updatedBy - The user ID performing the update
407
+ * @returns A new immutable audit info instance
408
+ */
409
+ abstract update(updatedBy: BaseUuidV4Vo): BaseAuditInfoVo;
410
+ /**
411
+ * The user ID who created the entity.
412
+ * Returns `undefined` for system-created entities.
413
+ */
414
+ get createdBy(): BaseUuidV4Vo | undefined;
415
+ /**
416
+ * The timestamp when the entity was created.
417
+ * Returns a cloned Date to prevent mutation.
418
+ */
419
+ get createdAt(): Date;
420
+ /**
421
+ * The user ID who last updated the entity.
422
+ * Returns `undefined` for system-updated entities.
423
+ */
424
+ get updatedBy(): BaseUuidV4Vo | undefined;
425
+ /**
426
+ * The timestamp when the entity was last updated.
427
+ * Returns a cloned Date to prevent mutation.
428
+ */
429
+ get updatedAt(): Date;
430
+ /**
431
+ * Whether the entity has been modified since creation.
432
+ *
433
+ * Compares both timestamps and user IDs. Returns `true` if either:
434
+ * - The updatedAt timestamp differs from createdAt
435
+ * - The updatedBy user differs from createdBy
436
+ *
437
+ * Note: When both createdBy and updatedBy are undefined (system-created
438
+ * entities), this correctly returns false for the user comparison.
439
+ */
440
+ get isModified(): boolean;
441
+ /**
442
+ * Alias for `updatedBy` for semantic clarity.
443
+ */
444
+ get lastModifiedBy(): BaseUuidV4Vo | undefined;
445
+ /**
446
+ * Alias for `updatedAt` for semantic clarity.
447
+ */
448
+ get lastModifiedAt(): Date;
449
+ }
450
+
451
+ /**
452
+ * Base email value object.
453
+ *
454
+ * Represents a validated email address. Extend this class and provide
455
+ * a validator that enforces email format rules.
456
+ *
457
+ * @example Extending with Zod validation
458
+ * ```typescript
459
+ * import { z } from 'zod';
460
+ * import { createZodValidator } from '@cosmneo/onion-lasagna/backend/core/validators/zod';
461
+ *
462
+ * const emailSchema = z.string().email();
463
+ * const emailValidator = createZodValidator(emailSchema);
464
+ *
465
+ * class EmailVo extends BaseEmailVo {
466
+ * static create(value: string): EmailVo {
467
+ * return new EmailVo(value, emailValidator);
468
+ * }
469
+ * }
470
+ * ```
471
+ *
472
+ * @example Usage
473
+ * ```typescript
474
+ * const email = EmailVo.create('user@example.com');
475
+ * console.log(email.value); // "user@example.com"
476
+ * ```
477
+ */
478
+
479
+ /**
480
+ * Value object for email addresses.
481
+ *
482
+ * @extends BaseValueObject<string>
483
+ */
484
+ declare class BaseEmailVo extends BaseValueObject<string> {
485
+ /**
486
+ * Creates a new BaseEmailVo instance.
487
+ *
488
+ * @param value - The email address string
489
+ * @param validator - Bound validator or skip validation symbol
490
+ */
491
+ protected constructor(value: string, validator: BoundValidator<string> | typeof SKIP_VALUE_OBJECT_VALIDATION);
492
+ }
493
+
494
+ /**
495
+ * Base long text value object.
496
+ *
497
+ * Represents long-form text fields like articles, content bodies, or notes.
498
+ * Typically validated with a maximum length constraint (e.g., 5000+ chars).
499
+ *
500
+ * **Suggested Length:** 1-5000+ characters
501
+ *
502
+ * **Use Cases:**
503
+ * - Article content
504
+ * - Blog posts
505
+ * - Detailed notes
506
+ * - Rich text content
507
+ *
508
+ * @example Extending with length validation
509
+ * ```typescript
510
+ * import { z } from 'zod';
511
+ * import { createZodValidator } from '@cosmneo/onion-lasagna/backend/core/validators/zod';
512
+ *
513
+ * const longTextSchema = z.string().min(1).max(10000);
514
+ * const longTextValidator = createZodValidator(longTextSchema);
515
+ *
516
+ * class ArticleContentVo extends BaseLongTextVo {
517
+ * static create(value: string): ArticleContentVo {
518
+ * return new ArticleContentVo(value, longTextValidator);
519
+ * }
520
+ * }
521
+ * ```
522
+ */
523
+
524
+ /**
525
+ * Value object for long-form text strings.
526
+ *
527
+ * @extends BaseValueObject<string>
528
+ */
529
+ declare class BaseLongTextVo extends BaseValueObject<string> {
530
+ /**
531
+ * Creates a new BaseLongTextVo instance.
532
+ *
533
+ * @param value - The long text string
534
+ * @param validator - Bound validator or skip validation symbol
535
+ */
536
+ protected constructor(value: string, validator: BoundValidator<string> | typeof SKIP_VALUE_OBJECT_VALIDATION);
537
+ }
538
+
539
+ /**
540
+ * Base medium text value object.
541
+ *
542
+ * Represents medium-length text fields like descriptions or summaries.
543
+ * Typically validated with a maximum length constraint (e.g., 500 chars).
544
+ *
545
+ * **Suggested Length:** 1-500 characters
546
+ *
547
+ * **Use Cases:**
548
+ * - Product descriptions
549
+ * - User bios
550
+ * - Short summaries
551
+ * - Comments
552
+ *
553
+ * @example Extending with length validation
554
+ * ```typescript
555
+ * import { z } from 'zod';
556
+ * import { createZodValidator } from '@cosmneo/onion-lasagna/backend/core/validators/zod';
557
+ *
558
+ * const mediumTextSchema = z.string().min(1).max(500);
559
+ * const mediumTextValidator = createZodValidator(mediumTextSchema);
560
+ *
561
+ * class DescriptionVo extends BaseMediumTextVo {
562
+ * static create(value: string): DescriptionVo {
563
+ * return new DescriptionVo(value, mediumTextValidator);
564
+ * }
565
+ * }
566
+ * ```
567
+ */
568
+
569
+ /**
570
+ * Value object for medium-length text strings.
571
+ *
572
+ * @extends BaseValueObject<string>
573
+ */
574
+ declare class BaseMediumTextVo extends BaseValueObject<string> {
575
+ /**
576
+ * Creates a new BaseMediumTextVo instance.
577
+ *
578
+ * @param value - The medium text string
579
+ * @param validator - Bound validator or skip validation symbol
580
+ */
581
+ protected constructor(value: string, validator: BoundValidator<string> | typeof SKIP_VALUE_OBJECT_VALIDATION);
582
+ }
583
+
584
+ /**
585
+ * Base pagination value object.
586
+ *
587
+ * Represents pagination parameters for list queries. Validates that
588
+ * page numbers and page sizes are positive integers within bounds.
589
+ *
590
+ * **Properties:**
591
+ * - `page`: The current page number (typically 1-indexed)
592
+ * - `pageSize`: Number of items per page
593
+ *
594
+ * @example Extending with validation
595
+ * ```typescript
596
+ * import { z } from 'zod';
597
+ * import { createZodValidator } from '@cosmneo/onion-lasagna/backend/core/validators/zod';
598
+ *
599
+ * const paginationSchema = z.object({
600
+ * page: z.number().int().min(1),
601
+ * pageSize: z.number().int().min(1).max(100),
602
+ * });
603
+ * const paginationValidator = createZodValidator(paginationSchema);
604
+ *
605
+ * class PaginationVo extends BasePaginationVo {
606
+ * static create(page: number, pageSize: number): PaginationVo {
607
+ * return new PaginationVo({ page, pageSize }, paginationValidator);
608
+ * }
609
+ * }
610
+ * ```
611
+ *
612
+ * @example Usage in a use case
613
+ * ```typescript
614
+ * class ListUsersUseCase {
615
+ * async execute(pagination: PaginationVo): Promise<User[]> {
616
+ * const offset = (pagination.page - 1) * pagination.pageSize;
617
+ * return this.userRepo.findAll({
618
+ * offset,
619
+ * limit: pagination.pageSize,
620
+ * });
621
+ * }
622
+ * }
623
+ * ```
624
+ */
625
+
626
+ /**
627
+ * Value object for pagination parameters.
628
+ *
629
+ * @extends BaseValueObject<{ page: number; pageSize: number }>
630
+ */
631
+ declare class BasePaginationVo extends BaseValueObject<{
632
+ page: number;
633
+ pageSize: number;
634
+ }> {
635
+ /**
636
+ * Creates a new BasePaginationVo instance.
637
+ *
638
+ * @param value - The pagination parameters
639
+ * @param value.page - The page number (typically 1-indexed)
640
+ * @param value.pageSize - The number of items per page
641
+ * @param validator - Bound validator or skip validation symbol
642
+ */
643
+ protected constructor(value: {
644
+ page: number;
645
+ pageSize: number;
646
+ }, validator: BoundValidator<{
647
+ page: number;
648
+ pageSize: number;
649
+ }> | typeof SKIP_VALUE_OBJECT_VALIDATION);
650
+ /**
651
+ * The current page number.
652
+ */
653
+ get page(): number;
654
+ /**
655
+ * The number of items per page.
656
+ */
657
+ get pageSize(): number;
658
+ }
659
+
660
+ /**
661
+ * Base short text value object.
662
+ *
663
+ * Represents short text fields like names, titles, or labels.
664
+ * Typically validated with a maximum length constraint (e.g., 100 chars).
665
+ *
666
+ * **Suggested Length:** 1-100 characters
667
+ *
668
+ * **Use Cases:**
669
+ * - User names
670
+ * - Product titles
671
+ * - Category names
672
+ * - Short labels
673
+ *
674
+ * @example Extending with length validation
675
+ * ```typescript
676
+ * import { z } from 'zod';
677
+ * import { createZodValidator } from '@cosmneo/onion-lasagna/backend/core/validators/zod';
678
+ *
679
+ * const shortTextSchema = z.string().min(1).max(100);
680
+ * const shortTextValidator = createZodValidator(shortTextSchema);
681
+ *
682
+ * class UserNameVo extends BaseShortTextVo {
683
+ * static create(value: string): UserNameVo {
684
+ * return new UserNameVo(value, shortTextValidator);
685
+ * }
686
+ * }
687
+ * ```
688
+ */
689
+
690
+ /**
691
+ * Value object for short text strings.
692
+ *
693
+ * @extends BaseValueObject<string>
694
+ */
695
+ declare class BaseShortTextVo extends BaseValueObject<string> {
696
+ /**
697
+ * Creates a new BaseShortTextVo instance.
698
+ *
699
+ * @param value - The short text string
700
+ * @param validator - Bound validator or skip validation symbol
701
+ */
702
+ protected constructor(value: string, validator: BoundValidator<string> | typeof SKIP_VALUE_OBJECT_VALIDATION);
703
+ }
704
+
705
+ /**
706
+ * Base UUID v7 value object for time-sortable entity identifiers.
707
+ *
708
+ * UUID v7 is a time-ordered UUID that combines a Unix timestamp with
709
+ * random bits, making it ideal for database primary keys because:
710
+ *
711
+ * **Benefits:**
712
+ * - **Time-sortable**: IDs created later sort after earlier ones
713
+ * - **Database-friendly**: Sequential nature reduces B-tree fragmentation
714
+ * - **Globally unique**: Same uniqueness guarantees as other UUID versions
715
+ * - **Timestamp extractable**: Creation time can be derived from the ID
716
+ *
717
+ * @example Generating a new ID
718
+ * ```typescript
719
+ * const id = BaseUuidV7Vo.generate();
720
+ * console.log(id.value); // e.g., "018f3b1c-5e7d-7000-8000-000000000001"
721
+ * ```
722
+ *
723
+ * @example Extending for validation
724
+ * ```typescript
725
+ * class EntityIdVo extends BaseUuidV7Vo {
726
+ * static create(value: string): EntityIdVo {
727
+ * return new EntityIdVo(value, uuidValidator);
728
+ * }
729
+ *
730
+ * static generate(): EntityIdVo {
731
+ * return new EntityIdVo(v7(), SKIP_VALUE_OBJECT_VALIDATION);
732
+ * }
733
+ * }
734
+ * ```
735
+ *
736
+ * @example Using as entity primary key
737
+ * ```typescript
738
+ * class User {
739
+ * constructor(
740
+ * public readonly id: EntityIdVo,
741
+ * public readonly name: string,
742
+ * ) {}
743
+ *
744
+ * static create(name: string): User {
745
+ * return new User(EntityIdVo.generate(), name);
746
+ * }
747
+ * }
748
+ * ```
749
+ */
750
+
751
+ /**
752
+ * Value object for UUID v7 identifiers.
753
+ *
754
+ * Provides a `generate()` factory method that creates new time-ordered UUIDs.
755
+ *
756
+ * @extends BaseValueObject<string>
757
+ */
758
+ declare class BaseUuidV7Vo extends BaseValueObject<string> {
759
+ /**
760
+ * Creates a new BaseUuidV7Vo instance.
761
+ *
762
+ * @param value - The UUID v7 string value
763
+ * @param validator - Bound validator or skip validation symbol
764
+ */
765
+ protected constructor(value: string, validator: BoundValidator<string> | typeof SKIP_VALUE_OBJECT_VALIDATION);
766
+ /**
767
+ * Generates a new UUID v7 value object.
768
+ *
769
+ * Creates a time-ordered UUID using the current timestamp,
770
+ * skipping validation since the `uuid` library guarantees format.
771
+ *
772
+ * @returns A new BaseUuidV7Vo with a freshly generated UUID
773
+ */
774
+ static generate(): BaseUuidV7Vo;
775
+ /**
776
+ * Creates a UUID v7 value object from an existing string.
777
+ *
778
+ * **Important:** This base implementation skips validation and accepts
779
+ * any string value. Subclasses should override this method with a
780
+ * validator to ensure UUID format correctness.
781
+ *
782
+ * @param value - The UUID v7 string value (not validated at base level)
783
+ * @returns A new BaseUuidV7Vo with the provided value
784
+ *
785
+ * @example Subclass with validation (recommended)
786
+ * ```typescript
787
+ * class OrderId extends BaseUuidV7Vo {
788
+ * static override create(value: string): OrderId {
789
+ * return new OrderId(value, uuidV7Validator);
790
+ * }
791
+ * }
792
+ * ```
793
+ *
794
+ * @see generate - For creating new UUIDs (always valid)
795
+ */
796
+ static create(value: string): BaseUuidV7Vo;
797
+ }
798
+
799
+ export { BaseAuditByVo as B, SKIP_VALUE_OBJECT_VALIDATION as S, BaseUuidV4Vo as a, BaseAuditInfoVo as b, BaseAuditOnVo as c, BaseEmailVo as d, BaseLongTextVo as e, BaseMediumTextVo as f, BasePaginationVo as g, BaseShortTextVo as h, BaseUuidV7Vo as i, BaseValueObject as j, type SkipValueObjectValidation as k };