@imolko/ultra-ddd 1.0.37-beta → 1.0.38-beta

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 (71) hide show
  1. package/dist-browser/entity/identity/humanid/conditions.js +1 -1
  2. package/dist-browser/entity/identity/humanid/conditions.js.map +1 -1
  3. package/dist-browser/entity/identity/numericid/conditions.d.ts.map +1 -1
  4. package/dist-browser/entity/identity/numericid/conditions.js +4 -3
  5. package/dist-browser/entity/identity/numericid/conditions.js.map +1 -1
  6. package/dist-browser/entity/identity/uuid/conditions.js +1 -1
  7. package/dist-browser/entity/identity/uuid/conditions.js.map +1 -1
  8. package/dist-browser/value-object/use-example/category/conditions.d.ts +15 -0
  9. package/dist-browser/value-object/use-example/category/conditions.d.ts.map +1 -0
  10. package/dist-browser/value-object/use-example/category/conditions.js +7 -0
  11. package/dist-browser/value-object/use-example/category/conditions.js.map +1 -0
  12. package/dist-browser/value-object/use-example/category/definition.d.ts +23 -0
  13. package/dist-browser/value-object/use-example/category/definition.d.ts.map +1 -0
  14. package/dist-browser/value-object/use-example/category/definition.js +43 -0
  15. package/dist-browser/value-object/use-example/category/definition.js.map +1 -0
  16. package/dist-browser/value-object/use-example/category/errors.d.ts +3 -0
  17. package/dist-browser/value-object/use-example/category/errors.d.ts.map +1 -0
  18. package/dist-browser/value-object/use-example/category/errors.js +2 -0
  19. package/dist-browser/value-object/use-example/category/errors.js.map +1 -0
  20. package/dist-browser/value-object/use-example/category/payload.d.ts +4 -0
  21. package/dist-browser/value-object/use-example/category/payload.d.ts.map +1 -0
  22. package/dist-browser/value-object/use-example/category/payload.js +2 -0
  23. package/dist-browser/value-object/use-example/category/payload.js.map +1 -0
  24. package/dist-browser/value-object/use-example/category/primitive.d.ts +6 -0
  25. package/dist-browser/value-object/use-example/category/primitive.d.ts.map +1 -0
  26. package/dist-browser/value-object/use-example/category/primitive.js +2 -0
  27. package/dist-browser/value-object/use-example/category/primitive.js.map +1 -0
  28. package/dist-browser/value-object/use-example/category/props.d.ts +12 -0
  29. package/dist-browser/value-object/use-example/category/props.d.ts.map +1 -0
  30. package/dist-browser/value-object/use-example/category/props.js +2 -0
  31. package/dist-browser/value-object/use-example/category/props.js.map +1 -0
  32. package/dist-browser/value-object/use-example/category/value-object.d.ts +210 -0
  33. package/dist-browser/value-object/use-example/category/value-object.d.ts.map +1 -0
  34. package/dist-browser/value-object/use-example/category/value-object.js +19 -0
  35. package/dist-browser/value-object/use-example/category/value-object.js.map +1 -0
  36. package/dist-node/entity/identity/humanid/conditions.js +1 -1
  37. package/dist-node/entity/identity/humanid/conditions.js.map +1 -1
  38. package/dist-node/entity/identity/numericid/conditions.d.ts.map +1 -1
  39. package/dist-node/entity/identity/numericid/conditions.js +4 -3
  40. package/dist-node/entity/identity/numericid/conditions.js.map +1 -1
  41. package/dist-node/entity/identity/uuid/conditions.js +1 -1
  42. package/dist-node/entity/identity/uuid/conditions.js.map +1 -1
  43. package/dist-node/value-object/use-example/category/conditions.d.ts +15 -0
  44. package/dist-node/value-object/use-example/category/conditions.d.ts.map +1 -0
  45. package/dist-node/value-object/use-example/category/conditions.js +10 -0
  46. package/dist-node/value-object/use-example/category/conditions.js.map +1 -0
  47. package/dist-node/value-object/use-example/category/definition.d.ts +23 -0
  48. package/dist-node/value-object/use-example/category/definition.d.ts.map +1 -0
  49. package/dist-node/value-object/use-example/category/definition.js +46 -0
  50. package/dist-node/value-object/use-example/category/definition.js.map +1 -0
  51. package/dist-node/value-object/use-example/category/errors.d.ts +3 -0
  52. package/dist-node/value-object/use-example/category/errors.d.ts.map +1 -0
  53. package/dist-node/value-object/use-example/category/errors.js +3 -0
  54. package/dist-node/value-object/use-example/category/errors.js.map +1 -0
  55. package/dist-node/value-object/use-example/category/payload.d.ts +4 -0
  56. package/dist-node/value-object/use-example/category/payload.d.ts.map +1 -0
  57. package/dist-node/value-object/use-example/category/payload.js +3 -0
  58. package/dist-node/value-object/use-example/category/payload.js.map +1 -0
  59. package/dist-node/value-object/use-example/category/primitive.d.ts +6 -0
  60. package/dist-node/value-object/use-example/category/primitive.d.ts.map +1 -0
  61. package/dist-node/value-object/use-example/category/primitive.js +3 -0
  62. package/dist-node/value-object/use-example/category/primitive.js.map +1 -0
  63. package/dist-node/value-object/use-example/category/props.d.ts +12 -0
  64. package/dist-node/value-object/use-example/category/props.d.ts.map +1 -0
  65. package/dist-node/value-object/use-example/category/props.js +3 -0
  66. package/dist-node/value-object/use-example/category/props.js.map +1 -0
  67. package/dist-node/value-object/use-example/category/value-object.d.ts +210 -0
  68. package/dist-node/value-object/use-example/category/value-object.d.ts.map +1 -0
  69. package/dist-node/value-object/use-example/category/value-object.js +22 -0
  70. package/dist-node/value-object/use-example/category/value-object.js.map +1 -0
  71. package/package.json +3 -2
@@ -2,6 +2,6 @@ import { z } from '@imolko/ultra-v8n';
2
2
  export const PATTERN = /^[A-Za-z]{3}:\d+$/;
3
3
  export const conditions = z.string()
4
4
  .trim()
5
- .regex(PATTERN)
5
+ .regex(PATTERN, { message: 'Incorrect human identifier, humanId, does not conform to pattern' })
6
6
  .transform(id => ({ id }));
7
7
  //# sourceMappingURL=conditions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../../../src/entity/identity/humanid/conditions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,MAAM,CAAC,MAAM,OAAO,GAAG,mBAAmB,CAAC;AAE3C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,EAAE;KAC/B,IAAI,EAAE;KACN,KAAK,CAAC,OAAO,CAAC;KACd,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAC,EAAE,EAAC,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../../../src/entity/identity/humanid/conditions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,MAAM,CAAC,MAAM,OAAO,GAAG,mBAAmB,CAAC;AAE3C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,EAAE;KAC/B,IAAI,EAAE;KACN,KAAK,CAAC,OAAO,EAAE,EAAC,OAAO,EAAE,kEAAkE,EAAC,CAAC;KAC7F,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAC,EAAE,EAAC,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"conditions.d.ts","sourceRoot":"","sources":["../../../../src/entity/identity/numericid/conditions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,eAAO,MAAM,UAAU;;UAIoB,CAAC"}
1
+ {"version":3,"file":"conditions.d.ts","sourceRoot":"","sources":["../../../../src/entity/identity/numericid/conditions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAItC,eAAO,MAAM,UAAU;;UAIoB,CAAC"}
@@ -1,7 +1,8 @@
1
1
  import { z } from '@imolko/ultra-v8n';
2
+ const MESSAGE = 'The identifier must be a positive integer.';
2
3
  export const conditions = z
3
- .number()
4
- .int()
5
- .nonnegative()
4
+ .number({ message: MESSAGE })
5
+ .int({ message: MESSAGE })
6
+ .nonnegative({ message: MESSAGE })
6
7
  .transform(id => ({ id: id.toString() }));
7
8
  //# sourceMappingURL=conditions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../../../src/entity/identity/numericid/conditions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC;KACtB,MAAM,EAAE;KACR,GAAG,EAAE;KACL,WAAW,EAAE;KACb,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAC,EAAE,EAAE,EAAE,CAAC,QAAQ,EAAE,EAAC,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../../../src/entity/identity/numericid/conditions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,MAAM,OAAO,GAAG,4CAA4C,CAAC;AAE7D,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC;KACtB,MAAM,CAAC,EAAC,OAAO,EAAE,OAAO,EAAC,CAAC;KAC1B,GAAG,CAAC,EAAC,OAAO,EAAE,OAAO,EAAC,CAAC;KACvB,WAAW,CAAC,EAAC,OAAO,EAAE,OAAO,EAAC,CAAC;KAC/B,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAC,EAAE,EAAE,EAAE,CAAC,QAAQ,EAAE,EAAC,CAAC,CAAC,CAAC"}
@@ -2,6 +2,6 @@ import { z } from '@imolko/ultra-v8n';
2
2
  export const PATTERN = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
3
3
  export const conditions = z.string()
4
4
  .trim()
5
- .regex(PATTERN)
5
+ .regex(PATTERN, { message: 'Incorrect UUID, does not meet the pattern' })
6
6
  .transform(id => ({ id }));
7
7
  //# sourceMappingURL=conditions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../../../src/entity/identity/uuid/conditions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,MAAM,CAAC,MAAM,OAAO,GAAG,+EAA+E,CAAC;AAEvG,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,EAAE;KAC/B,IAAI,EAAE;KACN,KAAK,CAAC,OAAO,CAAC;KACd,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAC,EAAE,EAAC,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../../../src/entity/identity/uuid/conditions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,MAAM,CAAC,MAAM,OAAO,GAAG,+EAA+E,CAAC;AAEvG,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,EAAE;KAC/B,IAAI,EAAE;KACN,KAAK,CAAC,OAAO,EAAE,EAAC,OAAO,EAAE,2CAA2C,EAAC,CAAC;KACtE,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAC,EAAE,EAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { z } from "@imolko/ultra-v8n";
2
+ export declare const conditions: z.ZodObject<{
3
+ id: z.ZodOptional<z.ZodNumber>;
4
+ name: z.ZodString;
5
+ slug: z.ZodOptional<z.ZodString>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ name: string;
8
+ id?: number | undefined;
9
+ slug?: string | undefined;
10
+ }, {
11
+ name: string;
12
+ id?: number | undefined;
13
+ slug?: string | undefined;
14
+ }>;
15
+ //# sourceMappingURL=conditions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditions.d.ts","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/conditions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,eAAO,MAAM,UAAU;;;;;;;;;;;;EAIrB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { z } from "@imolko/ultra-v8n";
2
+ export const conditions = z.object({
3
+ id: z.number().optional(),
4
+ name: z.string(),
5
+ slug: z.string().optional(),
6
+ });
7
+ //# sourceMappingURL=conditions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/conditions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { ZodSchema, ZodTypeDef } from "@imolko/ultra-v8n";
2
+ import { ValueObjectBase } from "../../value-object-base.class";
3
+ import { Payload } from "./payload";
4
+ import { Primitive } from "./primitive";
5
+ import { Props } from "./props";
6
+ export declare class Definition extends ValueObjectBase<Props, Primitive, Payload> {
7
+ /**
8
+ * Miembros estáticos
9
+ */
10
+ static readonly NAME = "category";
11
+ static readonly conditions: ZodSchema<Props, ZodTypeDef, Payload>;
12
+ /**
13
+ * Devuelve las propiedades serializadas para exponer en la aplicacion
14
+ * @returns {Primitive}
15
+ */
16
+ getPrimitive(): Primitive;
17
+ /**
18
+ * Devuelve las propiedades serializadas que permite las reconstruccion de la entidad
19
+ * @returns {Payload}
20
+ */
21
+ getPayload(): Payload;
22
+ }
23
+ //# sourceMappingURL=definition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,qBACa,UAAW,SAAQ,eAAe,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC;IACxE;;OAEG;IACH,gBAAuB,IAAI,cAAc;IACzC,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,CACpD;IACb;;;OAGG;IACI,YAAY,IAAI,SAAS;IAOhC;;;OAGG;IACI,UAAU,IAAI,OAAO;CAO7B"}
@@ -0,0 +1,43 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { isVOComplete } from "../../is-vo-complete.decorator";
8
+ import { ValueObjectBase } from "../../value-object-base.class";
9
+ import { conditions } from "./conditions";
10
+ let Definition = class Definition extends ValueObjectBase {
11
+ /**
12
+ * Devuelve las propiedades serializadas para exponer en la aplicacion
13
+ * @returns {Primitive}
14
+ */
15
+ getPrimitive() {
16
+ return {
17
+ id: this.props.id,
18
+ name: this.props.name,
19
+ slug: this.props.slug,
20
+ };
21
+ }
22
+ /**
23
+ * Devuelve las propiedades serializadas que permite las reconstruccion de la entidad
24
+ * @returns {Payload}
25
+ */
26
+ getPayload() {
27
+ return {
28
+ id: this.props.id,
29
+ name: this.props.name,
30
+ slug: this.props.slug,
31
+ };
32
+ }
33
+ };
34
+ /**
35
+ * Miembros estáticos
36
+ */
37
+ Definition.NAME = 'category';
38
+ Definition.conditions = conditions;
39
+ Definition = __decorate([
40
+ isVOComplete()
41
+ ], Definition);
42
+ export { Definition };
43
+ //# sourceMappingURL=definition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.js","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/definition.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAIhE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAGnC,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,eAA0C;IAOxE;;;OAGG;IACI,YAAY;QACjB,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE;YACjB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;YACrB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;SACtB,CAAC;IACJ,CAAC;IACD;;;OAGG;IACI,UAAU;QACf,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE;YACjB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;YACrB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;SACtB,CAAC;IACJ,CAAC;;AA3BD;;GAEG;AACoB,eAAI,GAAG,UAAU,AAAb,CAAc;AACzB,qBAAU,GACxB,UAAU,AADc,CACb;AANF,UAAU;IADtB,YAAY,EAAE;GACF,UAAU,CA6BtB"}
@@ -0,0 +1,3 @@
1
+ import { InvalidTypeError } from '@imolko/ultra-v8n';
2
+ export type Errors = InvalidTypeError;
3
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,MAAM,MAAM,GAAG,gBAAgB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/errors.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { z } from '@imolko/ultra-v8n';
2
+ import { conditions } from './conditions';
3
+ export type Payload = z.input<typeof conditions>;
4
+ //# sourceMappingURL=payload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/payload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=payload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payload.js","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/payload.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ export interface Primitive {
2
+ id?: number;
3
+ name: string;
4
+ slug?: string;
5
+ }
6
+ //# sourceMappingURL=primitive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primitive.d.ts","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/primitive.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=primitive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primitive.js","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/primitive.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Propiedades de una categoría de producto.
3
+ * @property {number} id ID de la categoría.
4
+ * @property {string} [name] Nombre de la categoría.
5
+ * @property {string} [slug] Slug de la categoría.
6
+ */
7
+ export interface Props {
8
+ id?: number;
9
+ name: string;
10
+ slug?: string;
11
+ }
12
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/props.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,KAAK;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=props.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.js","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/props.ts"],"names":[],"mappings":""}
@@ -0,0 +1,210 @@
1
+ import { Definition } from "./definition";
2
+ import { Primitive } from "./primitive";
3
+ import { Props } from "./props";
4
+ declare const Category_base: ((abstract new (...args: any[]) => {
5
+ clone(changes: Partial<Props>): /*elided*/ any;
6
+ readonly props: Readonly<Props>;
7
+ equals<Implemented extends import("../..").ValueObjectBase<Props, Primitive, {
8
+ name: string;
9
+ id?: number | undefined;
10
+ slug?: string | undefined;
11
+ }>>(this: Implemented, other?: Implemented | undefined): boolean;
12
+ getPrimitive(): Primitive;
13
+ getPayload(): {
14
+ name: string;
15
+ id?: number | undefined;
16
+ slug?: string | undefined;
17
+ };
18
+ }) & {
19
+ factoryUsed: boolean;
20
+ rules<Implemented extends /*elided*/ any & {
21
+ new (...args: any[]): {
22
+ readonly props: Readonly<Props>;
23
+ equals<Implemented_1 extends import("../..").ValueObjectBase<Props, Primitive, {
24
+ name: string;
25
+ id?: number | undefined;
26
+ slug?: string | undefined;
27
+ }>>(this: Implemented_1, other?: Implemented_1 | undefined): boolean;
28
+ clone(changes: Partial<Props>): /*elided*/ any;
29
+ getPrimitive(): Primitive;
30
+ getPayload(): {
31
+ name: string;
32
+ id?: number | undefined;
33
+ slug?: string | undefined;
34
+ };
35
+ } & Props;
36
+ prototype: {
37
+ readonly props: Readonly<Props>;
38
+ equals<Implemented_1 extends import("../..").ValueObjectBase<Props, Primitive, {
39
+ name: string;
40
+ id?: number | undefined;
41
+ slug?: string | undefined;
42
+ }>>(this: Implemented_1, other?: Implemented_1 | undefined): boolean;
43
+ clone(changes: Partial<Props>): /*elided*/ any;
44
+ getPrimitive(): Primitive;
45
+ getPayload(): {
46
+ name: string;
47
+ id?: number | undefined;
48
+ slug?: string | undefined;
49
+ };
50
+ } & Props;
51
+ } & ((abstract new (...args: any[]) => {
52
+ readonly props: Readonly<Props>;
53
+ equals<Implemented_1 extends import("../..").ValueObjectBase<Props, Primitive, {
54
+ name: string;
55
+ id?: number | undefined;
56
+ slug?: string | undefined;
57
+ }>>(this: Implemented_1, other?: Implemented_1 | undefined): boolean;
58
+ clone(changes: Partial<Props>): /*elided*/ any;
59
+ getPrimitive(): Primitive;
60
+ getPayload(): {
61
+ name: string;
62
+ id?: number | undefined;
63
+ slug?: string | undefined;
64
+ };
65
+ }) & {
66
+ conditions: import("zod").ZodType;
67
+ builder?(value: Props): import("../..").ValueObjectBase<Props, Primitive, {
68
+ name: string;
69
+ id?: number | undefined;
70
+ slug?: string | undefined;
71
+ }>;
72
+ NAME: string;
73
+ }) & typeof Definition>(this: Implemented): import("zod").ZodType<InstanceType<Implemented>, import("zod").ZodTypeDef, {
74
+ name: string;
75
+ id?: number | undefined;
76
+ slug?: string | undefined;
77
+ }>;
78
+ of<Implemented extends /*elided*/ any & {
79
+ new (...args: any[]): {
80
+ readonly props: Readonly<Props>;
81
+ equals<Implemented_1 extends import("../..").ValueObjectBase<Props, Primitive, {
82
+ name: string;
83
+ id?: number | undefined;
84
+ slug?: string | undefined;
85
+ }>>(this: Implemented_1, other?: Implemented_1 | undefined): boolean;
86
+ clone(changes: Partial<Props>): /*elided*/ any;
87
+ getPrimitive(): Primitive;
88
+ getPayload(): {
89
+ name: string;
90
+ id?: number | undefined;
91
+ slug?: string | undefined;
92
+ };
93
+ } & Props;
94
+ prototype: {
95
+ readonly props: Readonly<Props>;
96
+ equals<Implemented_1 extends import("../..").ValueObjectBase<Props, Primitive, {
97
+ name: string;
98
+ id?: number | undefined;
99
+ slug?: string | undefined;
100
+ }>>(this: Implemented_1, other?: Implemented_1 | undefined): boolean;
101
+ clone(changes: Partial<Props>): /*elided*/ any;
102
+ getPrimitive(): Primitive;
103
+ getPayload(): {
104
+ name: string;
105
+ id?: number | undefined;
106
+ slug?: string | undefined;
107
+ };
108
+ } & Props;
109
+ } & ((abstract new (...args: any[]) => {
110
+ readonly props: Readonly<Props>;
111
+ equals<Implemented_1 extends import("../..").ValueObjectBase<Props, Primitive, {
112
+ name: string;
113
+ id?: number | undefined;
114
+ slug?: string | undefined;
115
+ }>>(this: Implemented_1, other?: Implemented_1 | undefined): boolean;
116
+ clone(changes: Partial<Props>): /*elided*/ any;
117
+ getPrimitive(): Primitive;
118
+ getPayload(): {
119
+ name: string;
120
+ id?: number | undefined;
121
+ slug?: string | undefined;
122
+ };
123
+ }) & {
124
+ conditions: import("zod").ZodType;
125
+ builder?(value: Props): import("../..").ValueObjectBase<Props, Primitive, {
126
+ name: string;
127
+ id?: number | undefined;
128
+ slug?: string | undefined;
129
+ }>;
130
+ NAME: string;
131
+ }) & typeof Definition>(this: Implemented, payload: {
132
+ name: string;
133
+ id?: number | undefined;
134
+ slug?: string | undefined;
135
+ }): import("@imolko/ultra-result").Validation<import("@imolko/ultra-v8n").InvalidTypeError, InstanceType<Implemented>>;
136
+ builder(props: Props): {
137
+ clone(changes: Partial<Props>): /*elided*/ any;
138
+ readonly props: Readonly<Props>;
139
+ equals<Implemented extends import("../..").ValueObjectBase<Props, Primitive, {
140
+ name: string;
141
+ id?: number | undefined;
142
+ slug?: string | undefined;
143
+ }>>(this: Implemented, other?: Implemented | undefined): boolean;
144
+ getPrimitive(): Primitive;
145
+ getPayload(): {
146
+ name: string;
147
+ id?: number | undefined;
148
+ slug?: string | undefined;
149
+ };
150
+ };
151
+ conditions: import("zod").ZodType;
152
+ NAME: string;
153
+ }) & {
154
+ new (...args: any[]): {
155
+ readonly props: Readonly<Props>;
156
+ equals<Implemented extends import("../..").ValueObjectBase<Props, Primitive, {
157
+ name: string;
158
+ id?: number | undefined;
159
+ slug?: string | undefined;
160
+ }>>(this: Implemented, other?: Implemented | undefined): boolean;
161
+ clone(changes: Partial<Props>): /*elided*/ any;
162
+ getPrimitive(): Primitive;
163
+ getPayload(): {
164
+ name: string;
165
+ id?: number | undefined;
166
+ slug?: string | undefined;
167
+ };
168
+ } & Props;
169
+ prototype: {
170
+ readonly props: Readonly<Props>;
171
+ equals<Implemented extends import("../..").ValueObjectBase<Props, Primitive, {
172
+ name: string;
173
+ id?: number | undefined;
174
+ slug?: string | undefined;
175
+ }>>(this: Implemented, other?: Implemented | undefined): boolean;
176
+ clone(changes: Partial<Props>): /*elided*/ any;
177
+ getPrimitive(): Primitive;
178
+ getPayload(): {
179
+ name: string;
180
+ id?: number | undefined;
181
+ slug?: string | undefined;
182
+ };
183
+ } & Props;
184
+ } & ((abstract new (...args: any[]) => {
185
+ readonly props: Readonly<Props>;
186
+ equals<Implemented extends import("../..").ValueObjectBase<Props, Primitive, {
187
+ name: string;
188
+ id?: number | undefined;
189
+ slug?: string | undefined;
190
+ }>>(this: Implemented, other?: Implemented | undefined): boolean;
191
+ clone(changes: Partial<Props>): /*elided*/ any;
192
+ getPrimitive(): Primitive;
193
+ getPayload(): {
194
+ name: string;
195
+ id?: number | undefined;
196
+ slug?: string | undefined;
197
+ };
198
+ }) & {
199
+ conditions: import("zod").ZodType;
200
+ builder?(value: Props): import("../..").ValueObjectBase<Props, Primitive, {
201
+ name: string;
202
+ id?: number | undefined;
203
+ slug?: string | undefined;
204
+ }>;
205
+ NAME: string;
206
+ }) & typeof Definition;
207
+ export declare class Category extends Category_base {
208
+ }
209
+ export {};
210
+ //# sourceMappingURL=value-object.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"value-object.d.ts","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/value-object.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEhC,qBAIa,QAAS,SAAQ,aAMjB;CAAG"}
@@ -0,0 +1,19 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { RegisterValueObject } from "../../register-value-object.decorator";
8
+ import { ValueObjectWithPublicApi } from "../../value-object-with-public-api.mixin";
9
+ import { Definition } from "./definition";
10
+ let Category = class Category extends ValueObjectWithPublicApi(Definition) {
11
+ };
12
+ Category = __decorate([
13
+ RegisterValueObject({
14
+ description: 'Propiedades de una categoría de producto.',
15
+ domain: 'use-example',
16
+ })
17
+ ], Category);
18
+ export { Category };
19
+ //# sourceMappingURL=value-object.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"value-object.js","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/value-object.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAUnC,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,wBAAwB,CAMpD,UAAU,CAAC;CAAG,CAAA;AANH,QAAQ;IAJpB,mBAAmB,CAAC;QACnB,WAAW,EAAE,2CAA2C;QACxD,MAAM,EAAE,aAAa;KACtB,CAAC;GACW,QAAQ,CAML"}
@@ -5,6 +5,6 @@ const ultra_v8n_1 = require("@imolko/ultra-v8n");
5
5
  exports.PATTERN = /^[A-Za-z]{3}:\d+$/;
6
6
  exports.conditions = ultra_v8n_1.z.string()
7
7
  .trim()
8
- .regex(exports.PATTERN)
8
+ .regex(exports.PATTERN, { message: 'Incorrect human identifier, humanId, does not conform to pattern' })
9
9
  .transform(id => ({ id }));
10
10
  //# sourceMappingURL=conditions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../../../src/entity/identity/humanid/conditions.ts"],"names":[],"mappings":";;;AAAA,iDAAsC;AAEzB,QAAA,OAAO,GAAG,mBAAmB,CAAC;AAE9B,QAAA,UAAU,GAAG,aAAC,CAAC,MAAM,EAAE;KAC/B,IAAI,EAAE;KACN,KAAK,CAAC,eAAO,CAAC;KACd,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAC,EAAE,EAAC,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../../../src/entity/identity/humanid/conditions.ts"],"names":[],"mappings":";;;AAAA,iDAAsC;AAEzB,QAAA,OAAO,GAAG,mBAAmB,CAAC;AAE9B,QAAA,UAAU,GAAG,aAAC,CAAC,MAAM,EAAE;KAC/B,IAAI,EAAE;KACN,KAAK,CAAC,eAAO,EAAE,EAAC,OAAO,EAAE,kEAAkE,EAAC,CAAC;KAC7F,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAC,EAAE,EAAC,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"conditions.d.ts","sourceRoot":"","sources":["../../../../src/entity/identity/numericid/conditions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,eAAO,MAAM,UAAU;;UAIoB,CAAC"}
1
+ {"version":3,"file":"conditions.d.ts","sourceRoot":"","sources":["../../../../src/entity/identity/numericid/conditions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAItC,eAAO,MAAM,UAAU;;UAIoB,CAAC"}
@@ -2,9 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.conditions = void 0;
4
4
  const ultra_v8n_1 = require("@imolko/ultra-v8n");
5
+ const MESSAGE = 'The identifier must be a positive integer.';
5
6
  exports.conditions = ultra_v8n_1.z
6
- .number()
7
- .int()
8
- .nonnegative()
7
+ .number({ message: MESSAGE })
8
+ .int({ message: MESSAGE })
9
+ .nonnegative({ message: MESSAGE })
9
10
  .transform(id => ({ id: id.toString() }));
10
11
  //# sourceMappingURL=conditions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../../../src/entity/identity/numericid/conditions.ts"],"names":[],"mappings":";;;AAAA,iDAAsC;AAEzB,QAAA,UAAU,GAAG,aAAC;KACtB,MAAM,EAAE;KACR,GAAG,EAAE;KACL,WAAW,EAAE;KACb,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAC,EAAE,EAAE,EAAE,CAAC,QAAQ,EAAE,EAAC,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../../../src/entity/identity/numericid/conditions.ts"],"names":[],"mappings":";;;AAAA,iDAAsC;AAEtC,MAAM,OAAO,GAAG,4CAA4C,CAAC;AAEhD,QAAA,UAAU,GAAG,aAAC;KACtB,MAAM,CAAC,EAAC,OAAO,EAAE,OAAO,EAAC,CAAC;KAC1B,GAAG,CAAC,EAAC,OAAO,EAAE,OAAO,EAAC,CAAC;KACvB,WAAW,CAAC,EAAC,OAAO,EAAE,OAAO,EAAC,CAAC;KAC/B,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAC,EAAE,EAAE,EAAE,CAAC,QAAQ,EAAE,EAAC,CAAC,CAAC,CAAC"}
@@ -5,6 +5,6 @@ const ultra_v8n_1 = require("@imolko/ultra-v8n");
5
5
  exports.PATTERN = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
6
6
  exports.conditions = ultra_v8n_1.z.string()
7
7
  .trim()
8
- .regex(exports.PATTERN)
8
+ .regex(exports.PATTERN, { message: 'Incorrect UUID, does not meet the pattern' })
9
9
  .transform(id => ({ id }));
10
10
  //# sourceMappingURL=conditions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../../../src/entity/identity/uuid/conditions.ts"],"names":[],"mappings":";;;AAAA,iDAAsC;AAEzB,QAAA,OAAO,GAAG,+EAA+E,CAAC;AAE1F,QAAA,UAAU,GAAG,aAAC,CAAC,MAAM,EAAE;KAC/B,IAAI,EAAE;KACN,KAAK,CAAC,eAAO,CAAC;KACd,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAC,EAAE,EAAC,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../../../src/entity/identity/uuid/conditions.ts"],"names":[],"mappings":";;;AAAA,iDAAsC;AAEzB,QAAA,OAAO,GAAG,+EAA+E,CAAC;AAE1F,QAAA,UAAU,GAAG,aAAC,CAAC,MAAM,EAAE;KAC/B,IAAI,EAAE;KACN,KAAK,CAAC,eAAO,EAAE,EAAC,OAAO,EAAE,2CAA2C,EAAC,CAAC;KACtE,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAC,EAAE,EAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { z } from "@imolko/ultra-v8n";
2
+ export declare const conditions: z.ZodObject<{
3
+ id: z.ZodOptional<z.ZodNumber>;
4
+ name: z.ZodString;
5
+ slug: z.ZodOptional<z.ZodString>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ name: string;
8
+ id?: number | undefined;
9
+ slug?: string | undefined;
10
+ }, {
11
+ name: string;
12
+ id?: number | undefined;
13
+ slug?: string | undefined;
14
+ }>;
15
+ //# sourceMappingURL=conditions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditions.d.ts","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/conditions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,eAAO,MAAM,UAAU;;;;;;;;;;;;EAIrB,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.conditions = void 0;
4
+ const ultra_v8n_1 = require("@imolko/ultra-v8n");
5
+ exports.conditions = ultra_v8n_1.z.object({
6
+ id: ultra_v8n_1.z.number().optional(),
7
+ name: ultra_v8n_1.z.string(),
8
+ slug: ultra_v8n_1.z.string().optional(),
9
+ });
10
+ //# sourceMappingURL=conditions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/conditions.ts"],"names":[],"mappings":";;;AAAA,iDAAsC;AAEzB,QAAA,UAAU,GAAG,aAAC,CAAC,MAAM,CAAC;IACjC,EAAE,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,IAAI,EAAE,aAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { ZodSchema, ZodTypeDef } from "@imolko/ultra-v8n";
2
+ import { ValueObjectBase } from "../../value-object-base.class";
3
+ import { Payload } from "./payload";
4
+ import { Primitive } from "./primitive";
5
+ import { Props } from "./props";
6
+ export declare class Definition extends ValueObjectBase<Props, Primitive, Payload> {
7
+ /**
8
+ * Miembros estáticos
9
+ */
10
+ static readonly NAME = "category";
11
+ static readonly conditions: ZodSchema<Props, ZodTypeDef, Payload>;
12
+ /**
13
+ * Devuelve las propiedades serializadas para exponer en la aplicacion
14
+ * @returns {Primitive}
15
+ */
16
+ getPrimitive(): Primitive;
17
+ /**
18
+ * Devuelve las propiedades serializadas que permite las reconstruccion de la entidad
19
+ * @returns {Payload}
20
+ */
21
+ getPayload(): Payload;
22
+ }
23
+ //# sourceMappingURL=definition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,qBACa,UAAW,SAAQ,eAAe,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC;IACxE;;OAEG;IACH,gBAAuB,IAAI,cAAc;IACzC,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,CACpD;IACb;;;OAGG;IACI,YAAY,IAAI,SAAS;IAOhC;;;OAGG;IACI,UAAU,IAAI,OAAO;CAO7B"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.Definition = void 0;
10
+ const is_vo_complete_decorator_1 = require("../../is-vo-complete.decorator");
11
+ const value_object_base_class_1 = require("../../value-object-base.class");
12
+ const conditions_1 = require("./conditions");
13
+ let Definition = class Definition extends value_object_base_class_1.ValueObjectBase {
14
+ /**
15
+ * Devuelve las propiedades serializadas para exponer en la aplicacion
16
+ * @returns {Primitive}
17
+ */
18
+ getPrimitive() {
19
+ return {
20
+ id: this.props.id,
21
+ name: this.props.name,
22
+ slug: this.props.slug,
23
+ };
24
+ }
25
+ /**
26
+ * Devuelve las propiedades serializadas que permite las reconstruccion de la entidad
27
+ * @returns {Payload}
28
+ */
29
+ getPayload() {
30
+ return {
31
+ id: this.props.id,
32
+ name: this.props.name,
33
+ slug: this.props.slug,
34
+ };
35
+ }
36
+ };
37
+ exports.Definition = Definition;
38
+ /**
39
+ * Miembros estáticos
40
+ */
41
+ Definition.NAME = 'category';
42
+ Definition.conditions = conditions_1.conditions;
43
+ exports.Definition = Definition = __decorate([
44
+ (0, is_vo_complete_decorator_1.isVOComplete)()
45
+ ], Definition);
46
+ //# sourceMappingURL=definition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.js","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/definition.ts"],"names":[],"mappings":";;;;;;;;;AACA,6EAA8D;AAC9D,2EAAgE;AAIhE,6CAA0C;AAGnC,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,yCAA0C;IAOxE;;;OAGG;IACI,YAAY;QACjB,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE;YACjB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;YACrB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;SACtB,CAAC;IACJ,CAAC;IACD;;;OAGG;IACI,UAAU;QACf,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE;YACjB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;YACrB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;SACtB,CAAC;IACJ,CAAC;;AA5BU,gCAAU;AACrB;;GAEG;AACoB,eAAI,GAAG,UAAU,AAAb,CAAc;AACzB,qBAAU,GACxB,uBAAU,AADc,CACb;qBANF,UAAU;IADtB,IAAA,uCAAY,GAAE;GACF,UAAU,CA6BtB"}
@@ -0,0 +1,3 @@
1
+ import { InvalidTypeError } from '@imolko/ultra-v8n';
2
+ export type Errors = InvalidTypeError;
3
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,MAAM,MAAM,GAAG,gBAAgB,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/errors.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { z } from '@imolko/ultra-v8n';
2
+ import { conditions } from './conditions';
3
+ export type Payload = z.input<typeof conditions>;
4
+ //# sourceMappingURL=payload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/payload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=payload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payload.js","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/payload.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ export interface Primitive {
2
+ id?: number;
3
+ name: string;
4
+ slug?: string;
5
+ }
6
+ //# sourceMappingURL=primitive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primitive.d.ts","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/primitive.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=primitive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primitive.js","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/primitive.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Propiedades de una categoría de producto.
3
+ * @property {number} id ID de la categoría.
4
+ * @property {string} [name] Nombre de la categoría.
5
+ * @property {string} [slug] Slug de la categoría.
6
+ */
7
+ export interface Props {
8
+ id?: number;
9
+ name: string;
10
+ slug?: string;
11
+ }
12
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/props.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,KAAK;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=props.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.js","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/props.ts"],"names":[],"mappings":""}
@@ -0,0 +1,210 @@
1
+ import { Definition } from "./definition";
2
+ import { Primitive } from "./primitive";
3
+ import { Props } from "./props";
4
+ declare const Category_base: ((abstract new (...args: any[]) => {
5
+ clone(changes: Partial<Props>): /*elided*/ any;
6
+ readonly props: Readonly<Props>;
7
+ equals<Implemented extends import("../..").ValueObjectBase<Props, Primitive, {
8
+ name: string;
9
+ id?: number | undefined;
10
+ slug?: string | undefined;
11
+ }>>(this: Implemented, other?: Implemented | undefined): boolean;
12
+ getPrimitive(): Primitive;
13
+ getPayload(): {
14
+ name: string;
15
+ id?: number | undefined;
16
+ slug?: string | undefined;
17
+ };
18
+ }) & {
19
+ factoryUsed: boolean;
20
+ rules<Implemented extends /*elided*/ any & {
21
+ new (...args: any[]): {
22
+ readonly props: Readonly<Props>;
23
+ equals<Implemented_1 extends import("../..").ValueObjectBase<Props, Primitive, {
24
+ name: string;
25
+ id?: number | undefined;
26
+ slug?: string | undefined;
27
+ }>>(this: Implemented_1, other?: Implemented_1 | undefined): boolean;
28
+ clone(changes: Partial<Props>): /*elided*/ any;
29
+ getPrimitive(): Primitive;
30
+ getPayload(): {
31
+ name: string;
32
+ id?: number | undefined;
33
+ slug?: string | undefined;
34
+ };
35
+ } & Props;
36
+ prototype: {
37
+ readonly props: Readonly<Props>;
38
+ equals<Implemented_1 extends import("../..").ValueObjectBase<Props, Primitive, {
39
+ name: string;
40
+ id?: number | undefined;
41
+ slug?: string | undefined;
42
+ }>>(this: Implemented_1, other?: Implemented_1 | undefined): boolean;
43
+ clone(changes: Partial<Props>): /*elided*/ any;
44
+ getPrimitive(): Primitive;
45
+ getPayload(): {
46
+ name: string;
47
+ id?: number | undefined;
48
+ slug?: string | undefined;
49
+ };
50
+ } & Props;
51
+ } & ((abstract new (...args: any[]) => {
52
+ readonly props: Readonly<Props>;
53
+ equals<Implemented_1 extends import("../..").ValueObjectBase<Props, Primitive, {
54
+ name: string;
55
+ id?: number | undefined;
56
+ slug?: string | undefined;
57
+ }>>(this: Implemented_1, other?: Implemented_1 | undefined): boolean;
58
+ clone(changes: Partial<Props>): /*elided*/ any;
59
+ getPrimitive(): Primitive;
60
+ getPayload(): {
61
+ name: string;
62
+ id?: number | undefined;
63
+ slug?: string | undefined;
64
+ };
65
+ }) & {
66
+ conditions: import("zod").ZodType;
67
+ builder?(value: Props): import("../..").ValueObjectBase<Props, Primitive, {
68
+ name: string;
69
+ id?: number | undefined;
70
+ slug?: string | undefined;
71
+ }>;
72
+ NAME: string;
73
+ }) & typeof Definition>(this: Implemented): import("zod").ZodType<InstanceType<Implemented>, import("zod").ZodTypeDef, {
74
+ name: string;
75
+ id?: number | undefined;
76
+ slug?: string | undefined;
77
+ }>;
78
+ of<Implemented extends /*elided*/ any & {
79
+ new (...args: any[]): {
80
+ readonly props: Readonly<Props>;
81
+ equals<Implemented_1 extends import("../..").ValueObjectBase<Props, Primitive, {
82
+ name: string;
83
+ id?: number | undefined;
84
+ slug?: string | undefined;
85
+ }>>(this: Implemented_1, other?: Implemented_1 | undefined): boolean;
86
+ clone(changes: Partial<Props>): /*elided*/ any;
87
+ getPrimitive(): Primitive;
88
+ getPayload(): {
89
+ name: string;
90
+ id?: number | undefined;
91
+ slug?: string | undefined;
92
+ };
93
+ } & Props;
94
+ prototype: {
95
+ readonly props: Readonly<Props>;
96
+ equals<Implemented_1 extends import("../..").ValueObjectBase<Props, Primitive, {
97
+ name: string;
98
+ id?: number | undefined;
99
+ slug?: string | undefined;
100
+ }>>(this: Implemented_1, other?: Implemented_1 | undefined): boolean;
101
+ clone(changes: Partial<Props>): /*elided*/ any;
102
+ getPrimitive(): Primitive;
103
+ getPayload(): {
104
+ name: string;
105
+ id?: number | undefined;
106
+ slug?: string | undefined;
107
+ };
108
+ } & Props;
109
+ } & ((abstract new (...args: any[]) => {
110
+ readonly props: Readonly<Props>;
111
+ equals<Implemented_1 extends import("../..").ValueObjectBase<Props, Primitive, {
112
+ name: string;
113
+ id?: number | undefined;
114
+ slug?: string | undefined;
115
+ }>>(this: Implemented_1, other?: Implemented_1 | undefined): boolean;
116
+ clone(changes: Partial<Props>): /*elided*/ any;
117
+ getPrimitive(): Primitive;
118
+ getPayload(): {
119
+ name: string;
120
+ id?: number | undefined;
121
+ slug?: string | undefined;
122
+ };
123
+ }) & {
124
+ conditions: import("zod").ZodType;
125
+ builder?(value: Props): import("../..").ValueObjectBase<Props, Primitive, {
126
+ name: string;
127
+ id?: number | undefined;
128
+ slug?: string | undefined;
129
+ }>;
130
+ NAME: string;
131
+ }) & typeof Definition>(this: Implemented, payload: {
132
+ name: string;
133
+ id?: number | undefined;
134
+ slug?: string | undefined;
135
+ }): import("@imolko/ultra-result").Validation<import("@imolko/ultra-v8n").InvalidTypeError, InstanceType<Implemented>>;
136
+ builder(props: Props): {
137
+ clone(changes: Partial<Props>): /*elided*/ any;
138
+ readonly props: Readonly<Props>;
139
+ equals<Implemented extends import("../..").ValueObjectBase<Props, Primitive, {
140
+ name: string;
141
+ id?: number | undefined;
142
+ slug?: string | undefined;
143
+ }>>(this: Implemented, other?: Implemented | undefined): boolean;
144
+ getPrimitive(): Primitive;
145
+ getPayload(): {
146
+ name: string;
147
+ id?: number | undefined;
148
+ slug?: string | undefined;
149
+ };
150
+ };
151
+ conditions: import("zod").ZodType;
152
+ NAME: string;
153
+ }) & {
154
+ new (...args: any[]): {
155
+ readonly props: Readonly<Props>;
156
+ equals<Implemented extends import("../..").ValueObjectBase<Props, Primitive, {
157
+ name: string;
158
+ id?: number | undefined;
159
+ slug?: string | undefined;
160
+ }>>(this: Implemented, other?: Implemented | undefined): boolean;
161
+ clone(changes: Partial<Props>): /*elided*/ any;
162
+ getPrimitive(): Primitive;
163
+ getPayload(): {
164
+ name: string;
165
+ id?: number | undefined;
166
+ slug?: string | undefined;
167
+ };
168
+ } & Props;
169
+ prototype: {
170
+ readonly props: Readonly<Props>;
171
+ equals<Implemented extends import("../..").ValueObjectBase<Props, Primitive, {
172
+ name: string;
173
+ id?: number | undefined;
174
+ slug?: string | undefined;
175
+ }>>(this: Implemented, other?: Implemented | undefined): boolean;
176
+ clone(changes: Partial<Props>): /*elided*/ any;
177
+ getPrimitive(): Primitive;
178
+ getPayload(): {
179
+ name: string;
180
+ id?: number | undefined;
181
+ slug?: string | undefined;
182
+ };
183
+ } & Props;
184
+ } & ((abstract new (...args: any[]) => {
185
+ readonly props: Readonly<Props>;
186
+ equals<Implemented extends import("../..").ValueObjectBase<Props, Primitive, {
187
+ name: string;
188
+ id?: number | undefined;
189
+ slug?: string | undefined;
190
+ }>>(this: Implemented, other?: Implemented | undefined): boolean;
191
+ clone(changes: Partial<Props>): /*elided*/ any;
192
+ getPrimitive(): Primitive;
193
+ getPayload(): {
194
+ name: string;
195
+ id?: number | undefined;
196
+ slug?: string | undefined;
197
+ };
198
+ }) & {
199
+ conditions: import("zod").ZodType;
200
+ builder?(value: Props): import("../..").ValueObjectBase<Props, Primitive, {
201
+ name: string;
202
+ id?: number | undefined;
203
+ slug?: string | undefined;
204
+ }>;
205
+ NAME: string;
206
+ }) & typeof Definition;
207
+ export declare class Category extends Category_base {
208
+ }
209
+ export {};
210
+ //# sourceMappingURL=value-object.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"value-object.d.ts","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/value-object.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEhC,qBAIa,QAAS,SAAQ,aAMjB;CAAG"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.Category = void 0;
10
+ const register_value_object_decorator_1 = require("../../register-value-object.decorator");
11
+ const value_object_with_public_api_mixin_1 = require("../../value-object-with-public-api.mixin");
12
+ const definition_1 = require("./definition");
13
+ let Category = class Category extends (0, value_object_with_public_api_mixin_1.ValueObjectWithPublicApi)(definition_1.Definition) {
14
+ };
15
+ exports.Category = Category;
16
+ exports.Category = Category = __decorate([
17
+ (0, register_value_object_decorator_1.RegisterValueObject)({
18
+ description: 'Propiedades de una categoría de producto.',
19
+ domain: 'use-example',
20
+ })
21
+ ], Category);
22
+ //# sourceMappingURL=value-object.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"value-object.js","sourceRoot":"","sources":["../../../../src/value-object/use-example/category/value-object.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2FAA4E;AAC5E,iGAAoF;AACpF,6CAA0C;AAUnC,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,IAAA,6DAAwB,EAMpD,uBAAU,CAAC;CAAG,CAAA;AANH,4BAAQ;mBAAR,QAAQ;IAJpB,IAAA,qDAAmB,EAAC;QACnB,WAAW,EAAE,2CAA2C;QACxD,MAAM,EAAE,aAAa;KACtB,CAAC;GACW,QAAQ,CAML"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imolko/ultra-ddd",
3
- "version": "1.0.37-beta",
3
+ "version": "1.0.38-beta",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "results",
@@ -80,6 +80,7 @@
80
80
  "ajv": "~8.17.1",
81
81
  "ajv-formats": "~3.0.1",
82
82
  "uuid": "11.1.0",
83
- "zod-to-json-schema": "^3.24.6"
83
+ "zod": "^3.25.76",
84
+ "zod-to-json-schema": "^3.25.0"
84
85
  }
85
86
  }