@ddd-tool/domain-designer-cli 0.0.0-alpha.9 → 0.1.0-beta.1
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 +125 -13
- package/bin/domain-designer-cli.cjs +280 -99
- package/package.json +20 -19
- 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 +34 -155
- package/templates/node_modules/@ddd-tool/domain-designer-core/define.d.ts +259 -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 -1
- 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,10 +1,11 @@
|
|
|
1
|
-
import { NonEmptyArray, DomainDesignAgg, DomainDesignAggProvider, DomainDesignCommand, DomainDesignCommandProvider,
|
|
1
|
+
import { NonEmptyArray, DomainDesignAgg, DomainDesignAggProvider, DomainDesignCommand, DomainDesignCommandProvider, DomainDesignNoteProvider, DomainDesignEvent, DomainDesignEventProvider, DomainDesignFacadeCommand, DomainDesignFacadeCommandProvider, DomainDesignInfoProvider, DomainDesignActor, DomainDesignActorProvider, DomainDesignPolicy, DomainDesignPolicyProvider, DomainDesignService, DomainDesignServiceProvider, DomainDesignSystem, DomainDesignSystemProvider, DomainDesignReadModel, DomainDesignReadModelProvider, CustomInfoArrayToInfoObject, DomainDesignInfo, DomainDesignInfoType, CustomInfo, DomainDesignOptions, DomainObjectSet, DomainDesignObject } from './define';
|
|
2
2
|
export type LinkType = 'Association' | 'Dependency' | 'Aggregation' | 'Composition';
|
|
3
3
|
type Rule = 'Info' | 'Actor' | 'Command' | 'FacadeCommand' | 'Agg' | 'Event' | 'Policy' | 'Service' | 'System' | 'ReadModel';
|
|
4
4
|
export declare function genId(): string;
|
|
5
5
|
type ContextInitializer = () => {
|
|
6
6
|
id: string;
|
|
7
|
-
|
|
7
|
+
options: DomainDesignOptions;
|
|
8
|
+
createNote: DomainDesignNoteProvider;
|
|
8
9
|
createInfo: DomainDesignInfoProvider;
|
|
9
10
|
createActor: DomainDesignActorProvider;
|
|
10
11
|
createCommand: DomainDesignCommandProvider;
|
|
@@ -16,160 +17,29 @@ type ContextInitializer = () => {
|
|
|
16
17
|
createSystem: DomainDesignSystemProvider;
|
|
17
18
|
createReadModel: DomainDesignReadModelProvider;
|
|
18
19
|
};
|
|
20
|
+
export declare function defaultOptions(): Required<DomainDesignOptions>;
|
|
19
21
|
export type DomainDesignInternalContext = ReturnType<typeof createInternalContext>;
|
|
20
22
|
declare function createInternalContext(initFn: ContextInitializer): {
|
|
21
23
|
startWorkflow(name: string): string;
|
|
22
24
|
defineUserStory(name: string, workflowNames: NonEmptyArray<string>): void;
|
|
23
|
-
linkTo(srcRule: Rule,
|
|
24
|
-
|
|
25
|
+
linkTo(srcRule: Rule, srcId: string, targetRule: Rule, targetId: string, linkType?: LinkType): void;
|
|
26
|
+
getDesignerId(): string;
|
|
27
|
+
getDesignerOptions(): Required<DomainDesignOptions>;
|
|
25
28
|
getWorkflows(): Record<string, string[]>;
|
|
26
29
|
getUserStories(): Record<string, string[]>;
|
|
27
30
|
getLinks(): Record<string, LinkType>;
|
|
28
|
-
getIdMap(): Record<string,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
};
|
|
41
|
-
}> | undefined;
|
|
42
|
-
};
|
|
43
|
-
inner: any;
|
|
44
|
-
agg<AGG extends DomainDesignAgg<any>>(agg: AGG): AGG;
|
|
45
|
-
agg<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, agg: ARR, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignAgg<CustomInfoArrayToInfoObject<ARR>>;
|
|
46
|
-
}>[];
|
|
47
|
-
getFacadeCommands(): Readonly<{
|
|
48
|
-
readonly _attributes: {
|
|
49
|
-
__code: string;
|
|
50
|
-
rule: "FacadeCommand";
|
|
51
|
-
name: string;
|
|
52
|
-
infos: any;
|
|
53
|
-
description?: Readonly<{
|
|
54
|
-
readonly _attributes: {
|
|
55
|
-
rule: "Desc";
|
|
56
|
-
readonly template: TemplateStringsArray;
|
|
57
|
-
readonly values: import("@ddd-tool/domain-designer-core/define").DomainDesignDescValue[];
|
|
58
|
-
};
|
|
59
|
-
}> | undefined;
|
|
60
|
-
};
|
|
61
|
-
inner: any;
|
|
62
|
-
agg<AGG extends DomainDesignAgg<any>>(agg: AGG): AGG;
|
|
63
|
-
agg<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, agg: ARR, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignAgg<CustomInfoArrayToInfoObject<ARR>>;
|
|
64
|
-
service(service: DomainDesignService): DomainDesignService;
|
|
65
|
-
service(name: string, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignService;
|
|
66
|
-
}>[];
|
|
67
|
-
getActors(): Readonly<{
|
|
68
|
-
readonly _attributes: {
|
|
69
|
-
__code: string;
|
|
70
|
-
rule: "Actor";
|
|
71
|
-
name: string;
|
|
72
|
-
description?: import("@ddd-tool/domain-designer-core/define").DomainDesignDesc;
|
|
73
|
-
};
|
|
74
|
-
command<COMMAND extends DomainDesignCommand<any>>(command: COMMAND): COMMAND;
|
|
75
|
-
command<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, infos: ARR, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignCommand<CustomInfoArrayToInfoObject<ARR>>;
|
|
76
|
-
facadeCmd<FACADECMD extends DomainDesignFacadeCommand<any>>(command: FACADECMD): FACADECMD;
|
|
77
|
-
facadeCmd<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, infos: ARR, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignFacadeCommand<CustomInfoArrayToInfoObject<ARR>>;
|
|
78
|
-
readModel<READ_MODEL extends DomainDesignReadModel<any>>(readModel: READ_MODEL): READ_MODEL;
|
|
79
|
-
readModel<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, infos: ARR | import("@ddd-tool/domain-designer-core/define").NonEmptyInitFunc<() => ARR>): DomainDesignReadModel<CustomInfoArrayToInfoObject<ARR>>;
|
|
80
|
-
}>[];
|
|
81
|
-
getEvents(): Readonly<{
|
|
82
|
-
readonly _attributes: {
|
|
83
|
-
__code: string;
|
|
84
|
-
rule: "Event";
|
|
85
|
-
name: string;
|
|
86
|
-
infos: any;
|
|
87
|
-
description?: Readonly<{
|
|
88
|
-
readonly _attributes: {
|
|
89
|
-
rule: "Desc";
|
|
90
|
-
readonly template: TemplateStringsArray;
|
|
91
|
-
readonly values: import("@ddd-tool/domain-designer-core/define").DomainDesignDescValue[];
|
|
92
|
-
};
|
|
93
|
-
}> | undefined;
|
|
94
|
-
};
|
|
95
|
-
inner: any;
|
|
96
|
-
policy(policy: DomainDesignPolicy): DomainDesignPolicy;
|
|
97
|
-
policy(name: string, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignPolicy;
|
|
98
|
-
system(system: DomainDesignSystem): DomainDesignSystem;
|
|
99
|
-
system(name: string, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignSystem;
|
|
100
|
-
readModel<READ_MODEL extends DomainDesignReadModel<any>>(readModel: READ_MODEL): READ_MODEL;
|
|
101
|
-
readModel<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, infos: ARR | import("@ddd-tool/domain-designer-core/define").NonEmptyInitFunc<() => ARR>): DomainDesignReadModel<CustomInfoArrayToInfoObject<ARR>>;
|
|
102
|
-
}>[];
|
|
103
|
-
getPolicies(): Readonly<{
|
|
104
|
-
readonly _attributes: {
|
|
105
|
-
__code: string;
|
|
106
|
-
rule: "Policy";
|
|
107
|
-
name: string;
|
|
108
|
-
description?: import("@ddd-tool/domain-designer-core/define").DomainDesignDesc;
|
|
109
|
-
};
|
|
110
|
-
service(service: DomainDesignService): DomainDesignService;
|
|
111
|
-
service(name: string, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignService;
|
|
112
|
-
}>[];
|
|
113
|
-
getServices(): Readonly<{
|
|
114
|
-
readonly _attributes: {
|
|
115
|
-
__code: string;
|
|
116
|
-
rule: "Service";
|
|
117
|
-
name: string;
|
|
118
|
-
description?: import("@ddd-tool/domain-designer-core/define").DomainDesignDesc;
|
|
119
|
-
};
|
|
120
|
-
command<COMMAND extends DomainDesignCommand<any>>(command: COMMAND): COMMAND;
|
|
121
|
-
command<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, infos: ARR, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignCommand<CustomInfoArrayToInfoObject<ARR>>;
|
|
122
|
-
facadeCmd<FACADECMD extends DomainDesignFacadeCommand<any>>(facadeCmd: FACADECMD): FACADECMD;
|
|
123
|
-
facadeCmd<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, infos: ARR, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignFacadeCommand<CustomInfoArrayToInfoObject<ARR>>;
|
|
124
|
-
agg<AGG extends DomainDesignAgg<any>>(agg: AGG): AGG;
|
|
125
|
-
agg<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, agg: ARR, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignAgg<CustomInfoArrayToInfoObject<ARR>>;
|
|
126
|
-
}>[];
|
|
127
|
-
getSystems(): Readonly<{
|
|
128
|
-
readonly _attributes: {
|
|
129
|
-
__code: string;
|
|
130
|
-
rule: "System";
|
|
131
|
-
name: string;
|
|
132
|
-
description?: import("@ddd-tool/domain-designer-core/define").DomainDesignDesc;
|
|
133
|
-
};
|
|
134
|
-
command<COMMAND extends DomainDesignCommand<any>>(command: COMMAND): COMMAND;
|
|
135
|
-
command<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, infos: ARR, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignCommand<CustomInfoArrayToInfoObject<ARR>>;
|
|
136
|
-
facadeCmd<FACADECMD extends DomainDesignFacadeCommand<any>>(facadeCmd: FACADECMD): FACADECMD;
|
|
137
|
-
facadeCmd<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, infos: ARR, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignFacadeCommand<CustomInfoArrayToInfoObject<ARR>>;
|
|
138
|
-
}>[];
|
|
139
|
-
getAggs(): Readonly<{
|
|
140
|
-
readonly _attributes: {
|
|
141
|
-
__code: string;
|
|
142
|
-
rule: "Agg";
|
|
143
|
-
name: string;
|
|
144
|
-
infos: any;
|
|
145
|
-
description?: Readonly<{
|
|
146
|
-
readonly _attributes: {
|
|
147
|
-
rule: "Desc";
|
|
148
|
-
readonly template: TemplateStringsArray;
|
|
149
|
-
readonly values: import("@ddd-tool/domain-designer-core/define").DomainDesignDescValue[];
|
|
150
|
-
};
|
|
151
|
-
}> | undefined;
|
|
152
|
-
};
|
|
153
|
-
inner: any;
|
|
154
|
-
event<EVENT extends DomainDesignEvent<any>>(event: EVENT): EVENT;
|
|
155
|
-
event<G_NAME extends string, ARR extends NonEmptyArray<DomainDesignInfo<DomainDesignInfoType, G_NAME> | G_NAME>>(name: string, infos: ARR, desc?: string | import("@ddd-tool/domain-designer-core/define").DomainDesignDesc): DomainDesignEvent<CustomInfoArrayToInfoObject<ARR>>;
|
|
156
|
-
}>[];
|
|
157
|
-
getReadModels(): Readonly<{
|
|
158
|
-
readonly _attributes: {
|
|
159
|
-
__code: string;
|
|
160
|
-
rule: "ReadModel";
|
|
161
|
-
name: string;
|
|
162
|
-
infos: any;
|
|
163
|
-
description?: Readonly<{
|
|
164
|
-
readonly _attributes: {
|
|
165
|
-
rule: "Desc";
|
|
166
|
-
readonly template: TemplateStringsArray;
|
|
167
|
-
readonly values: import("@ddd-tool/domain-designer-core/define").DomainDesignDescValue[];
|
|
168
|
-
};
|
|
169
|
-
}> | undefined;
|
|
170
|
-
};
|
|
171
|
-
inner: any;
|
|
172
|
-
}>[];
|
|
31
|
+
getIdMap(): Record<string, DomainDesignObject>;
|
|
32
|
+
getAssociationMap(): Record<string, DomainObjectSet<DomainDesignObject>>;
|
|
33
|
+
getCommands(): DomainDesignCommand<any>[];
|
|
34
|
+
getFacadeCommands(): DomainDesignFacadeCommand<any>[];
|
|
35
|
+
getActors(): DomainDesignActor[];
|
|
36
|
+
getEvents(): DomainDesignEvent<any>[];
|
|
37
|
+
getPolicies(): DomainDesignPolicy[];
|
|
38
|
+
getServices(): DomainDesignService[];
|
|
39
|
+
getSystems(): DomainDesignSystem[];
|
|
40
|
+
getAggs(): DomainDesignAgg<any>[];
|
|
41
|
+
getReadModels(): DomainDesignReadModel<any>[];
|
|
42
|
+
registerInfo(info: DomainDesignInfo<any, any>): void;
|
|
173
43
|
registerCommand(command: DomainDesignCommand<any>): void;
|
|
174
44
|
registerFacadeCommand(command: DomainDesignFacadeCommand<any>): void;
|
|
175
45
|
registerActor(actor: DomainDesignActor): void;
|
|
@@ -179,13 +49,22 @@ declare function createInternalContext(initFn: ContextInitializer): {
|
|
|
179
49
|
registerSystem(system: DomainDesignSystem): void;
|
|
180
50
|
registerAgg(agg: DomainDesignAgg<any>): void;
|
|
181
51
|
registerReadModel(readModel: DomainDesignReadModel<any>): void;
|
|
182
|
-
customInfoArrToInfoObj<G_NAME extends string, ARR extends NonEmptyArray<
|
|
183
|
-
|
|
52
|
+
customInfoArrToInfoObj<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(arr: ARR): CustomInfoArrayToInfoObject<ARR>;
|
|
53
|
+
customInfoArrToInfoArr<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(arr: ARR): DomainDesignInfo<DomainDesignInfoType, string>[];
|
|
54
|
+
toFormat<OBJ extends {
|
|
55
|
+
_attributes: {
|
|
56
|
+
__id: string;
|
|
57
|
+
name: string;
|
|
58
|
+
};
|
|
59
|
+
}>(obj: OBJ): string;
|
|
60
|
+
createNote: DomainDesignNoteProvider;
|
|
184
61
|
info: {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
func
|
|
188
|
-
|
|
62
|
+
document<NAME extends string>(name: NAME, note?: string | import("./define").DomainDesignNote): DomainDesignInfo<"Document", NAME>;
|
|
63
|
+
func<NAME extends string>(name: NAME, note?: string | import("./define").DomainDesignNote): DomainDesignInfo<"Function", NAME>;
|
|
64
|
+
func<NAME extends string>(name: NAME, dependsOn: NonEmptyArray<import("./define").DomainDesignInfoFuncDependsOn | string | [string, string | import("./define").DomainDesignNote]>, note?: string | import("./define").DomainDesignNote): DomainDesignInfo<"Function", NAME>;
|
|
65
|
+
id<NAME extends string>(name: NAME, note?: string | import("./define").DomainDesignNote): DomainDesignInfo<"Id", NAME>;
|
|
66
|
+
valueObj<NAME extends string>(name: NAME, note?: string | import("./define").DomainDesignNote): DomainDesignInfo<"ValueObject", NAME>;
|
|
67
|
+
version<NAME extends string>(name: NAME, note?: string | import("./define").DomainDesignNote): DomainDesignInfo<"Version", NAME>;
|
|
189
68
|
};
|
|
190
69
|
createPersion: DomainDesignActorProvider;
|
|
191
70
|
createCommand: DomainDesignCommandProvider;
|