tshex-cli 1.0.12 → 1.0.14

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 (38) hide show
  1. package/LICENSE +21 -21
  2. package/build/main.js +60 -84
  3. package/package.json +50 -52
  4. package/readme.md +75 -75
  5. package/source/main.ts +84 -137
  6. package/templates/ctx/index.ts +9 -9
  7. package/templates/lib/index.d.ts +1 -1
  8. package/templates/lib/main.ts +5 -5
  9. package/templates/lib/shared/application/databases.ts +81 -0
  10. package/templates/lib/shared/application/events.ts +121 -0
  11. package/templates/lib/shared/application/{Response.ts → http.ts} +48 -52
  12. package/templates/{cls.example → lib/shared/application/loggers.ts} +50 -50
  13. package/templates/lib/shared/application/{Service.ts → services.ts} +43 -47
  14. package/templates/lib/shared/domain/{Aggregate.ts → aggregates.ts} +44 -48
  15. package/templates/lib/shared/domain/{Entity.ts → entities.ts} +46 -50
  16. package/templates/lib/shared/{application/DataTransferObject.ts → domain/errors.ts} +46 -46
  17. package/templates/lib/shared/domain/value-objects.ts +194 -0
  18. package/templates/ctx/ports/.gitkeep +0 -0
  19. package/templates/lib/shared/adapters/.gitkeep +0 -0
  20. package/templates/lib/shared/application/Logger.ts +0 -54
  21. package/templates/lib/shared/application/data/DataManager.ts +0 -50
  22. package/templates/lib/shared/application/data/Repository.ts +0 -55
  23. package/templates/lib/shared/application/errors/.gitkeep +0 -0
  24. package/templates/lib/shared/application/events/Event.ts +0 -56
  25. package/templates/lib/shared/application/events/EventDispatcher.ts +0 -55
  26. package/templates/lib/shared/application/events/EventHandler.ts +0 -50
  27. package/templates/lib/shared/constants/.gitkeep +0 -0
  28. package/templates/lib/shared/domain/errors/ValueError.ts +0 -69
  29. package/templates/lib/shared/domain/utils/.gitkeep +0 -0
  30. package/templates/lib/shared/domain/value-objects/BooleanValueObject.ts +0 -87
  31. package/templates/lib/shared/domain/value-objects/DateValueObject.ts +0 -100
  32. package/templates/lib/shared/domain/value-objects/EmailValueObject.ts +0 -89
  33. package/templates/lib/shared/domain/value-objects/NullableBooleanValueObject.ts +0 -87
  34. package/templates/lib/shared/domain/value-objects/NumericValueObject.ts +0 -136
  35. package/templates/lib/shared/domain/value-objects/StringValueObject.ts +0 -87
  36. package/templates/lib/shared/domain/value-objects/SymbolValueObject.ts +0 -82
  37. package/templates/lib/shared/domain/value-objects/ValueObject.ts +0 -57
  38. package/templates/rfc.example +0 -42
@@ -1,82 +0,0 @@
1
- // Libraries
2
-
3
- // Same Layer
4
-
5
- import ValueObject from './ValueObject.js';
6
-
7
- import ValueError from '../errors/ValueError.js';
8
-
9
- // Lower Layers
10
-
11
- // Types
12
-
13
- type T = symbol;
14
-
15
- // Constants
16
-
17
-
18
- /**
19
- * @description
20
- */
21
- export default class SymbolValueObject extends ValueObject
22
- {
23
-
24
- [property: string]: unknown;
25
-
26
- // public ATTRIBUTES
27
-
28
- public override readonly value: T;
29
-
30
- // protected ATTRIBUTES
31
-
32
- // private ATTRIBUTES
33
-
34
- // public static ATTRIBUTES
35
-
36
- // protected static ATTRIBUTES
37
-
38
- // private static ATTRIBUTES
39
-
40
- // Constructor, Getters, Setters
41
-
42
- protected constructor(value: T)
43
- {
44
- super();
45
- this.value = value;
46
- }
47
-
48
- // public METHODS
49
-
50
- public override equals(other: SymbolValueObject | null | undefined): boolean
51
- {
52
- if (other === null || other === undefined) {
53
- return false;
54
- }
55
-
56
- return this.value === other.value;
57
- }
58
-
59
- // protected METHODS
60
-
61
- // private METHODS
62
-
63
- // public static METHODS
64
-
65
- public static override isValid(value: unknown): boolean
66
- {
67
- return ('symbol' === typeof value);
68
- }
69
-
70
- public static from(value: T): SymbolValueObject
71
- {
72
- if (!this.isValid(value)) {
73
- throw new ValueError(value, this.name);
74
- }
75
- return new this(value);
76
- }
77
-
78
- // protected static METHODS
79
-
80
- // private static METHODS
81
-
82
- } //:: class
@@ -1,57 +0,0 @@
1
- // Libraries
2
-
3
- // Same Layer
4
-
5
- // Lower Layers
6
-
7
- // Types
8
-
9
- type TValue = string | symbol | number | bigint | boolean | object | null;
10
-
11
- // Constants
12
-
13
-
14
- /**
15
- * @description
16
- */
17
- export default abstract class ValueObject
18
- {
19
-
20
- [property: string]: unknown;
21
-
22
- // public ATTRIBUTES
23
-
24
- public abstract readonly value: TValue;
25
-
26
- // protected ATTRIBUTES
27
-
28
- // private ATTRIBUTES
29
-
30
- // public static ATTRIBUTES
31
-
32
- // protected static ATTRIBUTES
33
-
34
- // private static ATTRIBUTES
35
-
36
- // Constructor, Getters, Setters
37
-
38
- // public METHODS
39
-
40
- public abstract equals(other: ValueObject | null | undefined): boolean;
41
-
42
- // protected METHODS
43
-
44
- // private METHODS
45
-
46
- // public static METHODS
47
-
48
- public static isValid(value: unknown): boolean
49
- {
50
- return value !== null && value !== undefined && !Object.is(value, NaN);
51
- }
52
-
53
- // protected static METHODS
54
-
55
- // private static METHODS
56
-
57
- } //:: class
@@ -1,42 +0,0 @@
1
- // Libraries
2
-
3
- // Components
4
-
5
- // Hooks
6
-
7
- // Features
8
-
9
- // Languages
10
-
11
- // Styles
12
-
13
- // Types
14
-
15
- type Props = React.HTMLProps<HTMLElement> & {};
16
-
17
- // Constants
18
-
19
-
20
- /**
21
- * @description
22
- */
23
- export default function __COMPONENT__(props: Props): React.ReactElement
24
- {
25
-
26
- // MODELS -----------------------------
27
-
28
- // VIEW MODELS ------------------------
29
-
30
- // EFFECTS ---------------------------
31
-
32
- // HANDLERS --------------------------
33
-
34
- // VIEW ------------------------------
35
-
36
- return (
37
- <>
38
- {props.children}
39
- </>
40
- );
41
-
42
- } //:: ReactElement