tshex-cli 1.0.18 → 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +336 -546
- package/package.json +1 -1
- package/templates/lib/shared/application/data/drivers.ts +15 -0
- package/templates/lib/shared/application/data/managers.ts +81 -0
- package/templates/lib/shared/application/data/repositories.ts +29 -0
- package/templates/lib/shared/application/events.ts +5 -91
- package/templates/lib/shared/application/http.ts +0 -1
- package/templates/lib/shared/application/loggers.ts +2 -1
- package/templates/lib/shared/application/services.ts +2 -38
- package/templates/lib/shared/application/validations.ts +0 -4
- package/templates/lib/shared/domain/aggregates.ts +2 -39
- package/templates/lib/shared/domain/entities.ts +8 -37
- package/templates/lib/shared/domain/errors.ts +1 -37
- package/templates/lib/shared/domain/value-objects.ts +9 -91
- package/README.es.md +0 -1449
- package/templates/lib/shared/application/data-sources.ts +0 -102
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
type Generic<T = unknown> = Record<string, T>
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @description
|
|
5
|
-
*/
|
|
6
|
-
export interface Filterable<S = Generic> {
|
|
7
|
-
filter(selector: S): Promise<Array<S>>
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @description
|
|
12
|
-
*/
|
|
13
|
-
export interface Sortable<S = Generic> {
|
|
14
|
-
sort(selector: S): Promise<Array<S>>
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @description
|
|
19
|
-
*/
|
|
20
|
-
export interface Creatable<D = Generic> {
|
|
21
|
-
create(data: D): Promise<unknown>
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @description
|
|
26
|
-
*/
|
|
27
|
-
export interface Updatable<S = Generic, D = Generic> {
|
|
28
|
-
update(selector: S, data: D): Promise<unknown>
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* @description
|
|
33
|
-
*/
|
|
34
|
-
export interface Deletable<S = Generic> {
|
|
35
|
-
delete(selector: S): Promise<unknown>
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* @description
|
|
40
|
-
*/
|
|
41
|
-
export interface Aggregatable<S = Generic> {
|
|
42
|
-
aggregate(selector: S): Promise<S>
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* @description
|
|
47
|
-
*/
|
|
48
|
-
export interface Relatable {
|
|
49
|
-
selectRelated(...args: unknown[]): unknown
|
|
50
|
-
|
|
51
|
-
prefetchRelated(...args: unknown[]): unknown
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @description
|
|
56
|
-
*/
|
|
57
|
-
export abstract class DataManager<T = Generic> {
|
|
58
|
-
[property: string]: unknown
|
|
59
|
-
|
|
60
|
-
public abstract all(): Promise<Array<T>>
|
|
61
|
-
|
|
62
|
-
public abstract none(): Array<T>
|
|
63
|
-
} //:: class
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* @description
|
|
67
|
-
*/
|
|
68
|
-
export abstract class DatasetManager<T = Generic> extends DataManager<T> {
|
|
69
|
-
[property: string]: unknown
|
|
70
|
-
|
|
71
|
-
public abstract union(other: Array<T>): Promise<Array<T>>
|
|
72
|
-
|
|
73
|
-
public abstract intersection(other: Array<T>): Promise<Array<T>>
|
|
74
|
-
|
|
75
|
-
public abstract difference(other: Array<T>): Promise<Array<T>>
|
|
76
|
-
|
|
77
|
-
public abstract symmetricDifference(other: Array<T>): Promise<Array<T>>
|
|
78
|
-
|
|
79
|
-
public abstract complement(other: Array<T>): Promise<Array<T>>
|
|
80
|
-
} //:: class
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* @description
|
|
84
|
-
*/
|
|
85
|
-
export abstract class DriverManager<M extends DataManager = DataManager> {
|
|
86
|
-
[property: string]: unknown
|
|
87
|
-
|
|
88
|
-
public abstract connect(...args: unknown[]): Promise<M>
|
|
89
|
-
|
|
90
|
-
public abstract disconnect(): Promise<unknown>
|
|
91
|
-
} //:: class
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* @description Represents a data source.
|
|
95
|
-
*/
|
|
96
|
-
export abstract class Repository<M extends DriverManager = DriverManager> {
|
|
97
|
-
[property: string]: unknown
|
|
98
|
-
|
|
99
|
-
public constructor(public readonly manager: M) {}
|
|
100
|
-
|
|
101
|
-
protected abstract transform<T = Generic>(data: Generic): T
|
|
102
|
-
} //:: class
|