@ddd-tool/domain-designer-cli 0.0.0-alpha.8 → 0.1.0-beta.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.
- package/LICENSE +1 -1
- package/README.md +105 -10
- package/bin/domain-designer-cli.cjs +278 -98
- package/package.json +19 -18
- package/scripts/build-ts.mjs +52 -0
- package/scripts/sync-ver.mjs +0 -0
- package/src/views/design-en.ts +18 -31
- package/src/views/design-zh.ts +14 -24
- package/src/views/index.ts +12 -4
- package/templates/example-agg.ts +31 -0
- package/templates/example.ts +91 -0
- package/templates/node_modules/@ddd-tool/domain-designer-core/actor.d.ts +1 -1
- package/templates/node_modules/@ddd-tool/domain-designer-core/common.d.ts +33 -155
- package/templates/node_modules/@ddd-tool/domain-designer-core/define.d.ts +258 -124
- package/templates/node_modules/@ddd-tool/domain-designer-core/index.d.ts +3 -203
- package/templates/node_modules/@ddd-tool/domain-designer-core/info.d.ts +2 -0
- package/templates/node_modules/@ddd-tool/domain-designer-core/note.d.ts +2 -0
- package/templates/node_modules/@ddd-tool/domain-designer-core/policy.d.ts +1 -1
- package/templates/node_modules/@ddd-tool/domain-designer-core/service.d.ts +1 -1
- package/templates/node_modules/@ddd-tool/domain-designer-core/system.d.ts +1 -1
- package/templates/node_modules/version.txt +1 -0
- package/tsconfig.json +6 -19
- package/vite.config.ts +11 -5
- package/bin/domain-designer-cli.cjs.map +0 -7
- package/templates/node_modules/@ddd-tool/domain-designer-core/desc.d.ts +0 -2
- package/templates/node_modules/@ddd-tool/domain-designer-core/info/field.d.ts +0 -2
- package/templates/node_modules/@ddd-tool/domain-designer-core/info/index.d.ts +0 -3
- package/templates//347/244/272/344/276/213.ts +0 -31
|
@@ -1,172 +1,306 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
(
|
|
4
|
-
(
|
|
5
|
-
(
|
|
1
|
+
export declare class DomainObjectSet<T extends DomainDesignObject> implements Iterable<T> {
|
|
2
|
+
private record;
|
|
3
|
+
add(item: T): void;
|
|
4
|
+
has(item: T): boolean;
|
|
5
|
+
getById(__id: string): T;
|
|
6
|
+
delete(item: T): boolean;
|
|
7
|
+
[Symbol.iterator](): Iterator<T>;
|
|
8
|
+
}
|
|
9
|
+
export type DomainDesignRule = 'Note' | 'Info' | 'Actor' | 'Command' | 'FacadeCommand' | 'Event' | 'Agg' | 'System' | 'Policy' | 'Service' | 'ReadModel';
|
|
10
|
+
export interface DomainDesignObject {
|
|
11
|
+
readonly _attributes: {
|
|
12
|
+
readonly rule: DomainDesignRule;
|
|
13
|
+
readonly __id: string;
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly note?: DomainDesignNote;
|
|
16
|
+
};
|
|
6
17
|
}
|
|
7
|
-
export type
|
|
18
|
+
export type DomainDesignNoteProvider = {
|
|
19
|
+
(temp: undefined): undefined;
|
|
20
|
+
(temp: string): DomainDesignNote;
|
|
21
|
+
(temp: DomainDesignNote): DomainDesignNote;
|
|
22
|
+
(temp: TemplateStringsArray, ...values: DomainDesignNoteInject[]): DomainDesignNote;
|
|
23
|
+
};
|
|
24
|
+
export type DomainDesignNote = Readonly<{
|
|
8
25
|
readonly _attributes: {
|
|
9
|
-
rule: '
|
|
26
|
+
rule: Extract<DomainDesignRule, 'Note'>;
|
|
10
27
|
readonly template: TemplateStringsArray;
|
|
11
|
-
readonly
|
|
28
|
+
readonly inject: DomainDesignNoteInject[];
|
|
12
29
|
};
|
|
13
30
|
}>;
|
|
14
|
-
export type
|
|
31
|
+
export type DomainDesignNoteInject = DomainDesignInfo<any, any> | DomainDesignCommand<any> | DomainDesignFacadeCommand<any> | DomainDesignEvent<any> | DomainDesignAgg<any> | DomainDesignActor | DomainDesignSystem | DomainDesignPolicy | DomainDesignService;
|
|
15
32
|
export type DomainDesignInfoProvider = () => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
func
|
|
19
|
-
|
|
33
|
+
document<NAME extends string>(name: NAME, note?: string | DomainDesignNote): DomainDesignInfo<'Document', NAME>;
|
|
34
|
+
func<NAME extends string>(name: NAME, note?: string | DomainDesignNote): DomainDesignInfo<'Function', NAME>;
|
|
35
|
+
func<NAME extends string>(name: NAME, dependsOn: NonEmptyArray<DomainDesignInfoFuncDependsOn | string | [string, string | DomainDesignNote]>, note?: string | DomainDesignNote): DomainDesignInfo<'Function', NAME>;
|
|
36
|
+
id<NAME extends string>(name: NAME, note?: string | DomainDesignNote): DomainDesignInfo<'Id', NAME>;
|
|
37
|
+
valueObj<NAME extends string>(name: NAME, note?: string | DomainDesignNote): DomainDesignInfo<'ValueObject', NAME>;
|
|
38
|
+
version<NAME extends string>(name: NAME, note?: string | DomainDesignNote): DomainDesignInfo<'Version', NAME>;
|
|
20
39
|
};
|
|
21
|
-
export type DomainDesignInfoType = '
|
|
22
|
-
export type
|
|
23
|
-
export type
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
40
|
+
export type DomainDesignInfoType = 'Document' | 'Function' | 'Id' | 'ValueObject' | 'Version';
|
|
41
|
+
export type DomainDesignInfoSimplify<NAME extends string> = NAME | [NAME, string | DomainDesignNote];
|
|
42
|
+
export type DomainDesignInfoSubtype<TYPE extends DomainDesignInfoType> = TYPE extends 'Document' | 'Id' | 'Version' | 'ValueObject' ? 'None' : TYPE extends 'Function' ? DomainDesignInfoFuncDependsOn[] : never;
|
|
43
|
+
export interface DomainDesignInfo<TYPE extends DomainDesignInfoType, NAME extends string> extends DomainDesignObject {
|
|
44
|
+
readonly _attributes: {
|
|
45
|
+
readonly __id: string;
|
|
46
|
+
readonly rule: Extract<DomainDesignRule, 'Info'>;
|
|
47
|
+
readonly type: TYPE;
|
|
48
|
+
readonly subtype: DomainDesignInfoSubtype<TYPE>;
|
|
49
|
+
readonly name: NAME;
|
|
50
|
+
readonly note?: DomainDesignNote;
|
|
31
51
|
};
|
|
32
|
-
|
|
52
|
+
toFormat(): string;
|
|
53
|
+
}
|
|
33
54
|
export type DomainDesignInfoFuncDependsOn = DomainDesignInfo<Exclude<DomainDesignInfoType, 'Function'>, string>;
|
|
34
|
-
export type
|
|
35
|
-
export type
|
|
36
|
-
|
|
55
|
+
export type DomainDesignInfoRecord = NonEmptyObject<Record<string, DomainDesignInfo<DomainDesignInfoType, string>>>;
|
|
56
|
+
export type CustomInfo<G_NAME extends string> = DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME | [G_NAME, string | DomainDesignNote];
|
|
57
|
+
export type CustomInfoArrayToInfoObject<ARR extends Array<DomainDesignInfo<any, any> | string | [string, string | DomainDesignNote]>> = {
|
|
58
|
+
[K in ARR[number] as K extends DomainDesignInfo<any, infer U> ? U : K extends string ? K : K extends [infer U, any] ? U : never]: K extends DomainDesignInfo<any, any> ? K : K extends string ? DomainDesignInfo<'ValueObject', K> : K extends [infer U extends string, any] ? DomainDesignInfo<'ValueObject', U> : never;
|
|
37
59
|
};
|
|
38
|
-
export
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
enum<NAME extends string>(name: NAME, desc?: string | DomainDesignDesc): DomainDesignInfo<'Field', NAME>;
|
|
43
|
-
num<NAME extends string>(name: NAME, desc?: string | DomainDesignDesc): DomainDesignInfo<'Field', NAME>;
|
|
44
|
-
str<NAME extends string>(name: NAME, desc?: string | DomainDesignDesc): DomainDesignInfo<'Field', NAME>;
|
|
45
|
-
bool<NAME extends string>(name: NAME, desc?: string | DomainDesignDesc): DomainDesignInfo<'Field', NAME>;
|
|
46
|
-
}
|
|
47
|
-
export type DomainDesignActorProvider = (name: string, desc?: string | DomainDesignDesc) => DomainDesignActor;
|
|
48
|
-
export type DomainDesignActor = Readonly<{
|
|
60
|
+
export type DomainDesignActorProvider = {
|
|
61
|
+
(name: string, note?: string | DomainDesignNote): DomainDesignActor;
|
|
62
|
+
};
|
|
63
|
+
export interface DomainDesignActor extends DomainDesignObject {
|
|
49
64
|
readonly _attributes: {
|
|
50
|
-
|
|
51
|
-
rule: 'Actor'
|
|
52
|
-
name: string;
|
|
53
|
-
|
|
65
|
+
readonly __id: string;
|
|
66
|
+
readonly rule: Extract<DomainDesignRule, 'Actor'>;
|
|
67
|
+
readonly name: string;
|
|
68
|
+
readonly note?: DomainDesignNote;
|
|
54
69
|
};
|
|
55
70
|
command<COMMAND extends DomainDesignCommand<any>>(command: COMMAND): COMMAND;
|
|
56
|
-
command<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, infos: ARR,
|
|
71
|
+
command<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, infos: ARR, note?: string | DomainDesignNote): DomainDesignCommand<CustomInfoArrayToInfoObject<ARR>>;
|
|
57
72
|
facadeCmd<FACADECMD extends DomainDesignFacadeCommand<any>>(command: FACADECMD): FACADECMD;
|
|
58
|
-
facadeCmd<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, infos: ARR,
|
|
73
|
+
facadeCmd<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, infos: ARR, note?: string | DomainDesignNote): DomainDesignFacadeCommand<CustomInfoArrayToInfoObject<ARR>>;
|
|
59
74
|
readModel<READ_MODEL extends DomainDesignReadModel<any>>(readModel: READ_MODEL): READ_MODEL;
|
|
60
75
|
readModel<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, infos: ARR | NonEmptyInitFunc<() => ARR>): DomainDesignReadModel<CustomInfoArrayToInfoObject<ARR>>;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
export type
|
|
76
|
+
toFormat(): string;
|
|
77
|
+
}
|
|
78
|
+
export type DomainDesignCommandProvider = {
|
|
79
|
+
<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(name: string, infos: ARR | NonEmptyInitFunc<() => ARR>, note?: string | DomainDesignNote): DomainDesignCommand<CustomInfoArrayToInfoObject<ARR>>;
|
|
80
|
+
};
|
|
81
|
+
export interface DomainDesignCommand<INFOS extends DomainDesignInfoRecord> extends DomainDesignObject {
|
|
64
82
|
readonly _attributes: {
|
|
65
|
-
|
|
66
|
-
rule: 'Command'
|
|
67
|
-
name: string;
|
|
68
|
-
infos: INFOS;
|
|
69
|
-
|
|
83
|
+
readonly __id: string;
|
|
84
|
+
readonly rule: Extract<DomainDesignRule, 'Command'>;
|
|
85
|
+
readonly name: string;
|
|
86
|
+
readonly infos: INFOS;
|
|
87
|
+
readonly note?: DomainDesignNote;
|
|
70
88
|
};
|
|
71
|
-
inner: INFOS;
|
|
89
|
+
readonly inner: INFOS;
|
|
72
90
|
agg<AGG extends DomainDesignAgg<any>>(agg: AGG): AGG;
|
|
73
|
-
agg<G_NAME extends string, ARR extends NonEmptyArray<
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
export type
|
|
91
|
+
agg<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(name: string, agg: ARR, note?: string | DomainDesignNote): DomainDesignAgg<CustomInfoArrayToInfoObject<ARR>>;
|
|
92
|
+
toFormat(): string;
|
|
93
|
+
}
|
|
94
|
+
export type DomainDesignFacadeCommandProvider = {
|
|
95
|
+
<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(name: string, infos: ARR | NonEmptyInitFunc<() => ARR>, note?: string | DomainDesignNote): DomainDesignFacadeCommand<CustomInfoArrayToInfoObject<ARR>>;
|
|
96
|
+
};
|
|
97
|
+
export interface DomainDesignFacadeCommand<INFOS extends DomainDesignInfoRecord> extends DomainDesignObject {
|
|
77
98
|
readonly _attributes: {
|
|
78
|
-
|
|
79
|
-
rule: 'FacadeCommand'
|
|
80
|
-
name: string;
|
|
81
|
-
infos: INFOS;
|
|
82
|
-
|
|
99
|
+
readonly __id: string;
|
|
100
|
+
readonly rule: Extract<DomainDesignRule, 'FacadeCommand'>;
|
|
101
|
+
readonly name: string;
|
|
102
|
+
readonly infos: INFOS;
|
|
103
|
+
readonly note?: DomainDesignNote;
|
|
83
104
|
};
|
|
84
|
-
inner: INFOS;
|
|
105
|
+
readonly inner: INFOS;
|
|
85
106
|
agg<AGG extends DomainDesignAgg<any>>(agg: AGG): AGG;
|
|
86
|
-
agg<G_NAME extends string, ARR extends NonEmptyArray<
|
|
107
|
+
agg<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(name: string, agg: ARR, note?: string | DomainDesignNote): DomainDesignAgg<CustomInfoArrayToInfoObject<ARR>>;
|
|
87
108
|
service(service: DomainDesignService): DomainDesignService;
|
|
88
|
-
service(name: string,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
export type
|
|
109
|
+
service(name: string, note?: string | DomainDesignNote): DomainDesignService;
|
|
110
|
+
toFormat(): string;
|
|
111
|
+
}
|
|
112
|
+
export type DomainDesignEventProvider = {
|
|
113
|
+
<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(name: string, infos: ARR | NonEmptyInitFunc<() => ARR>, note?: string | DomainDesignNote): DomainDesignEvent<CustomInfoArrayToInfoObject<ARR>>;
|
|
114
|
+
};
|
|
115
|
+
export interface DomainDesignEvent<INFOS extends DomainDesignInfoRecord> extends DomainDesignObject {
|
|
92
116
|
readonly _attributes: {
|
|
93
|
-
|
|
94
|
-
rule: 'Event'
|
|
95
|
-
name: string;
|
|
96
|
-
infos: INFOS;
|
|
97
|
-
|
|
117
|
+
readonly __id: string;
|
|
118
|
+
readonly rule: Extract<DomainDesignRule, 'Event'>;
|
|
119
|
+
readonly name: string;
|
|
120
|
+
readonly infos: INFOS;
|
|
121
|
+
readonly note?: DomainDesignNote;
|
|
98
122
|
};
|
|
99
|
-
inner: INFOS;
|
|
123
|
+
readonly inner: INFOS;
|
|
100
124
|
policy(policy: DomainDesignPolicy): DomainDesignPolicy;
|
|
101
|
-
policy(name: string,
|
|
125
|
+
policy(name: string, note?: string | DomainDesignNote): DomainDesignPolicy;
|
|
102
126
|
system(system: DomainDesignSystem): DomainDesignSystem;
|
|
103
|
-
system(name: string,
|
|
127
|
+
system(name: string, note?: string | DomainDesignNote): DomainDesignSystem;
|
|
104
128
|
readModel<READ_MODEL extends DomainDesignReadModel<any>>(readModel: READ_MODEL): READ_MODEL;
|
|
105
|
-
readModel<G_NAME extends string, ARR extends NonEmptyArray<
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
export type
|
|
129
|
+
readModel<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(name: string, infos: ARR | NonEmptyInitFunc<() => ARR>): DomainDesignReadModel<CustomInfoArrayToInfoObject<ARR>>;
|
|
130
|
+
toFormat(): string;
|
|
131
|
+
}
|
|
132
|
+
export type DomainDesignAggProvider = {
|
|
133
|
+
<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(name: string, infos: ARR | NonEmptyInitFunc<() => ARR>, note?: string | DomainDesignNote): DomainDesignAgg<CustomInfoArrayToInfoObject<ARR>>;
|
|
134
|
+
};
|
|
135
|
+
export interface DomainDesignAgg<INFOS extends DomainDesignInfoRecord> extends DomainDesignObject {
|
|
109
136
|
readonly _attributes: {
|
|
110
|
-
|
|
111
|
-
rule: 'Agg'
|
|
112
|
-
name: string;
|
|
113
|
-
infos: INFOS;
|
|
114
|
-
|
|
137
|
+
readonly __id: string;
|
|
138
|
+
readonly rule: Extract<DomainDesignRule, 'Agg'>;
|
|
139
|
+
readonly name: string;
|
|
140
|
+
readonly infos: INFOS;
|
|
141
|
+
readonly note?: DomainDesignNote;
|
|
115
142
|
};
|
|
116
|
-
inner: INFOS;
|
|
143
|
+
readonly inner: INFOS;
|
|
117
144
|
event<EVENT extends DomainDesignEvent<any>>(event: EVENT): EVENT;
|
|
118
|
-
event<G_NAME extends string, ARR extends NonEmptyArray<
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
export type
|
|
145
|
+
event<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(name: string, infos: ARR, note?: string | DomainDesignNote): DomainDesignEvent<CustomInfoArrayToInfoObject<ARR>>;
|
|
146
|
+
toFormat(): string;
|
|
147
|
+
}
|
|
148
|
+
export type DomainDesignPolicyProvider = {
|
|
149
|
+
(name: string, note?: string | DomainDesignNote): DomainDesignPolicy;
|
|
150
|
+
};
|
|
151
|
+
export interface DomainDesignPolicy extends DomainDesignObject {
|
|
122
152
|
readonly _attributes: {
|
|
123
|
-
|
|
124
|
-
rule: 'Policy'
|
|
125
|
-
name: string;
|
|
126
|
-
|
|
153
|
+
readonly __id: string;
|
|
154
|
+
readonly rule: Extract<DomainDesignRule, 'Policy'>;
|
|
155
|
+
readonly name: string;
|
|
156
|
+
readonly note?: DomainDesignNote;
|
|
127
157
|
};
|
|
128
158
|
service(service: DomainDesignService): DomainDesignService;
|
|
129
|
-
service(name: string,
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
export type
|
|
159
|
+
service(name: string, note?: string | DomainDesignNote): DomainDesignService;
|
|
160
|
+
toFormat(): string;
|
|
161
|
+
}
|
|
162
|
+
export type DomainDesignSystemProvider = {
|
|
163
|
+
(name: string, note?: string | DomainDesignNote): DomainDesignSystem;
|
|
164
|
+
};
|
|
165
|
+
export interface DomainDesignSystem extends DomainDesignObject {
|
|
133
166
|
readonly _attributes: {
|
|
134
|
-
|
|
135
|
-
rule: 'System'
|
|
136
|
-
name: string;
|
|
137
|
-
|
|
167
|
+
readonly __id: string;
|
|
168
|
+
readonly rule: Extract<DomainDesignRule, 'System'>;
|
|
169
|
+
readonly name: string;
|
|
170
|
+
readonly note?: DomainDesignNote;
|
|
138
171
|
};
|
|
139
172
|
command<COMMAND extends DomainDesignCommand<any>>(command: COMMAND): COMMAND;
|
|
140
|
-
command<G_NAME extends string, ARR extends NonEmptyArray<
|
|
173
|
+
command<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(name: string, infos: ARR, note?: string | DomainDesignNote): DomainDesignCommand<CustomInfoArrayToInfoObject<ARR>>;
|
|
141
174
|
facadeCmd<FACADECMD extends DomainDesignFacadeCommand<any>>(facadeCmd: FACADECMD): FACADECMD;
|
|
142
|
-
facadeCmd<G_NAME extends string, ARR extends NonEmptyArray<
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
export type
|
|
175
|
+
facadeCmd<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(name: string, infos: ARR, note?: string | DomainDesignNote): DomainDesignFacadeCommand<CustomInfoArrayToInfoObject<ARR>>;
|
|
176
|
+
toFormat(): string;
|
|
177
|
+
}
|
|
178
|
+
export type DomainDesignServiceProvider = (name: string, note?: string | DomainDesignNote) => DomainDesignService;
|
|
179
|
+
export interface DomainDesignService extends DomainDesignObject {
|
|
146
180
|
readonly _attributes: {
|
|
147
|
-
|
|
148
|
-
rule: 'Service'
|
|
149
|
-
name: string;
|
|
150
|
-
|
|
181
|
+
readonly __id: string;
|
|
182
|
+
readonly rule: Extract<DomainDesignRule, 'Service'>;
|
|
183
|
+
readonly name: string;
|
|
184
|
+
readonly note?: DomainDesignNote;
|
|
151
185
|
};
|
|
152
186
|
command<COMMAND extends DomainDesignCommand<any>>(command: COMMAND): COMMAND;
|
|
153
|
-
command<G_NAME extends string, ARR extends NonEmptyArray<
|
|
187
|
+
command<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(name: string, infos: ARR, note?: string | DomainDesignNote): DomainDesignCommand<CustomInfoArrayToInfoObject<ARR>>;
|
|
154
188
|
facadeCmd<FACADECMD extends DomainDesignFacadeCommand<any>>(facadeCmd: FACADECMD): FACADECMD;
|
|
155
|
-
facadeCmd<G_NAME extends string, ARR extends NonEmptyArray<
|
|
189
|
+
facadeCmd<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(name: string, infos: ARR, note?: string | DomainDesignNote): DomainDesignFacadeCommand<CustomInfoArrayToInfoObject<ARR>>;
|
|
156
190
|
agg<AGG extends DomainDesignAgg<any>>(agg: AGG): AGG;
|
|
157
|
-
agg<G_NAME extends string, ARR extends NonEmptyArray<
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
export type
|
|
191
|
+
agg<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(name: string, agg: ARR, note?: string | DomainDesignNote): DomainDesignAgg<CustomInfoArrayToInfoObject<ARR>>;
|
|
192
|
+
toFormat(): string;
|
|
193
|
+
}
|
|
194
|
+
export type DomainDesignReadModelProvider = {
|
|
195
|
+
<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(name: string, infos: ARR | NonEmptyInitFunc<() => ARR>, note?: string | DomainDesignNote): DomainDesignReadModel<CustomInfoArrayToInfoObject<ARR>>;
|
|
196
|
+
};
|
|
197
|
+
export interface DomainDesignReadModel<INFOS extends DomainDesignInfoRecord> extends DomainDesignObject {
|
|
161
198
|
readonly _attributes: {
|
|
162
|
-
|
|
163
|
-
rule: 'ReadModel'
|
|
164
|
-
name: string;
|
|
165
|
-
infos: INFOS;
|
|
166
|
-
|
|
199
|
+
readonly __id: string;
|
|
200
|
+
readonly rule: Extract<DomainDesignRule, 'ReadModel'>;
|
|
201
|
+
readonly name: string;
|
|
202
|
+
readonly infos: INFOS;
|
|
203
|
+
readonly note?: DomainDesignNote;
|
|
167
204
|
};
|
|
168
|
-
inner: INFOS;
|
|
169
|
-
|
|
205
|
+
readonly inner: INFOS;
|
|
206
|
+
toFormat(): string;
|
|
207
|
+
}
|
|
208
|
+
export type DomainDesignOptions = {
|
|
209
|
+
moduleName: string;
|
|
210
|
+
__toFormatType?: 'BngleBrackets' | 'JSON' | 'JSONPretty';
|
|
211
|
+
};
|
|
170
212
|
export type NonEmptyArray<T> = [T, ...T[]];
|
|
171
213
|
export type NonEmptyObject<T extends object> = keyof T extends never ? never : T;
|
|
172
214
|
export type NonEmptyInitFunc<T extends () => object> = keyof ReturnType<T> extends never ? never : T;
|
|
215
|
+
export declare function isDomainDesignInfo(param: any): param is DomainDesignInfo<any, any>;
|
|
216
|
+
export declare function isDomainDesignInfoFunc<NAME extends string>(info: DomainDesignInfo<DomainDesignInfoType, NAME>): info is DomainDesignInfo<'Function', NAME>;
|
|
217
|
+
export declare function isDomainDesignActor(param: any): param is DomainDesignActor;
|
|
218
|
+
export declare function isDomainDesignAgg(param: any): param is DomainDesignAgg<any>;
|
|
219
|
+
export declare function isDomainDesignCommand(param: any): param is DomainDesignCommand<any>;
|
|
220
|
+
export declare function isDomainDesignFacadeCommand(param: any): param is DomainDesignFacadeCommand<any>;
|
|
221
|
+
export declare function isDomainDesignEvent(param: any): param is DomainDesignEvent<any>;
|
|
222
|
+
export declare function isDomainDesignPolicy(param: any): param is DomainDesignPolicy;
|
|
223
|
+
export declare function isDomainDesignReadModel(param: any): param is DomainDesignReadModel<any>;
|
|
224
|
+
export declare function isDomainDesignService(param: any): param is DomainDesignService;
|
|
225
|
+
export declare function isDomainDesignSystem(param: any): param is DomainDesignSystem;
|
|
226
|
+
export declare function isAnyDomainDesignObject(param: any): param is DomainDesignObject;
|
|
227
|
+
export declare function isDomainDesigner(param: any): param is DomainDesigner;
|
|
228
|
+
export type DomainDesigner = {
|
|
229
|
+
startWorkflow: (name: string) => string;
|
|
230
|
+
defineUserStory: (name: string, workflowNames: NonEmptyArray<string>) => void;
|
|
231
|
+
note: DomainDesignNoteProvider;
|
|
232
|
+
info: {
|
|
233
|
+
document<NAME extends string>(name: NAME, note?: string | DomainDesignNote): DomainDesignInfo<'Document', NAME>;
|
|
234
|
+
func<NAME extends string>(name: NAME, note?: string | DomainDesignNote): DomainDesignInfo<'Function', NAME>;
|
|
235
|
+
func<NAME extends string>(name: NAME, dependsOn: NonEmptyArray<DomainDesignInfoFuncDependsOn | string | [string, string | DomainDesignNote]>, note?: string | DomainDesignNote): DomainDesignInfo<'Function', NAME>;
|
|
236
|
+
id<NAME extends string>(name: NAME, note?: string | DomainDesignNote): DomainDesignInfo<'Id', NAME>;
|
|
237
|
+
valueObj<NAME extends string>(name: NAME, note?: string | DomainDesignNote): DomainDesignInfo<'ValueObject', NAME>;
|
|
238
|
+
version<NAME extends string>(name: NAME, note?: string | DomainDesignNote): DomainDesignInfo<'Version', NAME>;
|
|
239
|
+
};
|
|
240
|
+
actor: DomainDesignActorProvider;
|
|
241
|
+
command: DomainDesignCommandProvider;
|
|
242
|
+
facadeCmd: DomainDesignFacadeCommandProvider;
|
|
243
|
+
agg: DomainDesignAggProvider;
|
|
244
|
+
event: DomainDesignEventProvider;
|
|
245
|
+
system: DomainDesignSystemProvider;
|
|
246
|
+
policy: DomainDesignPolicyProvider;
|
|
247
|
+
service: DomainDesignServiceProvider;
|
|
248
|
+
readModel: DomainDesignReadModelProvider;
|
|
249
|
+
_getContext: () => {
|
|
250
|
+
startWorkflow(name: string): string;
|
|
251
|
+
defineUserStory(name: string, workflowNames: NonEmptyArray<string>): void;
|
|
252
|
+
linkTo(srcRule: 'Info' | 'Actor' | 'Command' | 'FacadeCommand' | 'Agg' | 'Event' | 'Policy' | 'Service' | 'System' | 'ReadModel', srcId: string, targetRule: 'Info' | 'Actor' | 'Command' | 'FacadeCommand' | 'Agg' | 'Event' | 'Policy' | 'Service' | 'System' | 'ReadModel', targetId: string, linkType?: import('./common').LinkType): void;
|
|
253
|
+
getDesignerId(): string;
|
|
254
|
+
getModuleName(): string;
|
|
255
|
+
getWorkflows(): Record<string, string[]>;
|
|
256
|
+
getUserStories(): Record<string, string[]>;
|
|
257
|
+
getLinks(): Record<string, import('./common').LinkType>;
|
|
258
|
+
getIdMap(): Record<string, DomainDesignObject>;
|
|
259
|
+
getAssociationMap(): Record<string, DomainObjectSet<DomainDesignObject>>;
|
|
260
|
+
getCommands(): DomainDesignCommand<any>[];
|
|
261
|
+
getFacadeCommands(): DomainDesignFacadeCommand<any>[];
|
|
262
|
+
getActors(): DomainDesignActor[];
|
|
263
|
+
getEvents(): DomainDesignEvent<any>[];
|
|
264
|
+
getPolicies(): DomainDesignPolicy[];
|
|
265
|
+
getServices(): DomainDesignService[];
|
|
266
|
+
getSystems(): DomainDesignSystem[];
|
|
267
|
+
getAggs(): DomainDesignAgg<any>[];
|
|
268
|
+
getReadModels(): DomainDesignReadModel<any>[];
|
|
269
|
+
registerInfo(info: DomainDesignInfo<any, any>): void;
|
|
270
|
+
registerCommand(command: DomainDesignCommand<any>): void;
|
|
271
|
+
registerFacadeCommand(command: DomainDesignFacadeCommand<any>): void;
|
|
272
|
+
registerActor(actor: DomainDesignActor): void;
|
|
273
|
+
registerEvent(event: DomainDesignEvent<any>): void;
|
|
274
|
+
registerPolicy(policy: DomainDesignPolicy): void;
|
|
275
|
+
registerService(service: DomainDesignService): void;
|
|
276
|
+
registerSystem(system: DomainDesignSystem): void;
|
|
277
|
+
registerAgg(agg: DomainDesignAgg<any>): void;
|
|
278
|
+
registerReadModel(readModel: DomainDesignReadModel<any>): void;
|
|
279
|
+
customInfoArrToInfoObj<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(arr: ARR): CustomInfoArrayToInfoObject<ARR>;
|
|
280
|
+
customInfoArrToInfoArr<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(arr: ARR): DomainDesignInfo<DomainDesignInfoType, string>[];
|
|
281
|
+
toFormat<OBJ extends {
|
|
282
|
+
_attributes: {
|
|
283
|
+
__id: string;
|
|
284
|
+
name: string;
|
|
285
|
+
};
|
|
286
|
+
}>(obj: OBJ): string;
|
|
287
|
+
createNote: DomainDesignNoteProvider;
|
|
288
|
+
info: {
|
|
289
|
+
document<NAME extends string>(name: NAME, note?: string | DomainDesignNote): DomainDesignInfo<'Document', NAME>;
|
|
290
|
+
func<NAME extends string>(name: NAME, note?: string | DomainDesignNote): DomainDesignInfo<'Function', NAME>;
|
|
291
|
+
func<NAME extends string>(name: NAME, dependsOn: NonEmptyArray<DomainDesignInfoFuncDependsOn | string | [string, string | DomainDesignNote]>, note?: string | DomainDesignNote): DomainDesignInfo<'Function', NAME>;
|
|
292
|
+
id<NAME extends string>(name: NAME, note?: string | DomainDesignNote): DomainDesignInfo<'Id', NAME>;
|
|
293
|
+
valueObj<NAME extends string>(name: NAME, note?: string | DomainDesignNote): DomainDesignInfo<'ValueObject', NAME>;
|
|
294
|
+
version<NAME extends string>(name: NAME, note?: string | DomainDesignNote): DomainDesignInfo<'Version', NAME>;
|
|
295
|
+
};
|
|
296
|
+
createPersion: DomainDesignActorProvider;
|
|
297
|
+
createCommand: DomainDesignCommandProvider;
|
|
298
|
+
createFacadeCommand: DomainDesignFacadeCommandProvider;
|
|
299
|
+
createAgg: DomainDesignAggProvider;
|
|
300
|
+
createEvent: DomainDesignEventProvider;
|
|
301
|
+
createPolicy: DomainDesignPolicyProvider;
|
|
302
|
+
createService: DomainDesignServiceProvider;
|
|
303
|
+
createSystem: DomainDesignSystemProvider;
|
|
304
|
+
createReadModel: DomainDesignReadModelProvider;
|
|
305
|
+
};
|
|
306
|
+
};
|