@ddd-tool/domain-designer-cli 0.3.0 → 0.3.2

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 (79) hide show
  1. package/bin/domain-designer-cli.cjs +19148 -19145
  2. package/package.json +4 -2
  3. package/packages/core/dist/README.md +43 -0
  4. package/packages/core/dist/actor.d.ts +2 -0
  5. package/packages/core/dist/agg.d.ts +2 -0
  6. package/packages/core/dist/command.d.ts +3 -0
  7. package/packages/core/dist/common.d.ts +158 -0
  8. package/packages/core/dist/event.d.ts +2 -0
  9. package/packages/core/dist/index.d.ts +33 -0
  10. package/packages/core/dist/index.js +1980 -0
  11. package/packages/core/dist/info.d.ts +2 -0
  12. package/packages/core/dist/note.d.ts +2 -0
  13. package/packages/core/dist/package.json +21 -0
  14. package/packages/core/dist/policy.d.ts +2 -0
  15. package/packages/core/dist/read-model.d.ts +2 -0
  16. package/packages/core/dist/service.d.ts +2 -0
  17. package/packages/core/dist/system.d.ts +2 -0
  18. package/packages/core/dist/types.d.ts +558 -0
  19. package/packages/playground/node_modules/.vite/deps/_metadata.json +7 -7
  20. package/packages/playground/package.json +19 -21
  21. package/packages/playground/src/views/Index.vue +16 -16
  22. package/packages/playground/src/views/complex-example-detail/book.ts +383 -383
  23. package/packages/playground/src/views/complex-example-detail/common.ts +4 -4
  24. package/packages/playground/src/views/complex-example-detail/user.ts +66 -66
  25. package/packages/playground/src/views/design-en.ts +110 -110
  26. package/packages/playground/src/views/design-zh.ts +97 -97
  27. package/packages/playground/src/views/index.ts +19 -19
  28. package/packages/playground/src/views/simple-example.ts +103 -103
  29. package/packages/playground/vite-env.d.ts +12 -12
  30. package/packages/playground/vite.config.ts +27 -21
  31. package/packages/ui-component/dist/LICENSE +201 -0
  32. package/packages/ui-component/dist/README.md +5 -0
  33. package/packages/ui-component/dist/UI.vue.d.ts +29 -0
  34. package/packages/ui-component/dist/common.d.ts +9 -0
  35. package/packages/ui-component/dist/components/drag-zoom/Index.vue.d.ts +37 -0
  36. package/packages/ui-component/dist/components/node-info/Index.vue.d.ts +29 -0
  37. package/packages/ui-component/dist/components/nomnoml/Index.vue.d.ts +24 -0
  38. package/packages/ui-component/dist/components/nomnoml/base-style.d.ts +2 -0
  39. package/packages/ui-component/dist/components/nomnoml/preprocess.d.ts +5 -0
  40. package/packages/ui-component/dist/components/story-bar/Index.vue.d.ts +28 -0
  41. package/packages/ui-component/dist/components/tool-bar/Index.vue.d.ts +29 -0
  42. package/packages/ui-component/dist/domain/common.d.ts +27 -0
  43. package/packages/ui-component/dist/domain/diagram-agg/gen-code.d.ts +64 -0
  44. package/packages/ui-component/dist/domain/diagram-agg/index.d.ts +8554 -0
  45. package/packages/ui-component/dist/domain/diagram-agg/plugins.d.ts +80 -0
  46. package/packages/ui-component/dist/domain/diagram-agg/types.d.ts +20 -0
  47. package/packages/ui-component/dist/domain/i18n-agg/index.d.ts +25 -0
  48. package/packages/ui-component/dist/domain/i18n-agg/locale/en-US.d.ts +3 -0
  49. package/packages/ui-component/dist/domain/i18n-agg/locale/zh-CN.d.ts +3 -0
  50. package/packages/ui-component/dist/domain/i18n-agg/message.d.ts +42 -0
  51. package/packages/ui-component/dist/domain/mount-plugin.d.ts +1 -0
  52. package/packages/ui-component/dist/favicon.ico +0 -0
  53. package/packages/ui-component/dist/index.css +144 -0
  54. package/packages/ui-component/dist/index.d.ts +6 -0
  55. package/packages/ui-component/dist/index.js +19776 -0
  56. package/packages/ui-component/dist/package.json +28 -0
  57. package/packages/ui-component/dist/ui.d.ts +8 -0
  58. package/scripts/build-ts.mjs +52 -52
  59. package/scripts/sync-version.mjs +22 -22
  60. package/templates/CLAUDE.md +273 -12
  61. package/templates/complex-example-detail/book.ts +386 -383
  62. package/templates/complex-example-detail/common.ts +4 -4
  63. package/templates/complex-example-detail/user.ts +66 -66
  64. package/templates/node_modules/@ddd-tool/domain-designer-core/actor.d.ts +2 -2
  65. package/templates/node_modules/@ddd-tool/domain-designer-core/agg.d.ts +2 -2
  66. package/templates/node_modules/@ddd-tool/domain-designer-core/command.d.ts +3 -3
  67. package/templates/node_modules/@ddd-tool/domain-designer-core/common.d.ts +79 -79
  68. package/templates/node_modules/@ddd-tool/domain-designer-core/event.d.ts +2 -2
  69. package/templates/node_modules/@ddd-tool/domain-designer-core/index.d.ts +4 -4
  70. package/templates/node_modules/@ddd-tool/domain-designer-core/info.d.ts +2 -2
  71. package/templates/node_modules/@ddd-tool/domain-designer-core/note.d.ts +2 -2
  72. package/templates/node_modules/@ddd-tool/domain-designer-core/policy.d.ts +2 -2
  73. package/templates/node_modules/@ddd-tool/domain-designer-core/read-model.d.ts +2 -2
  74. package/templates/node_modules/@ddd-tool/domain-designer-core/service.d.ts +2 -2
  75. package/templates/node_modules/@ddd-tool/domain-designer-core/system.d.ts +2 -2
  76. package/templates/node_modules/@ddd-tool/domain-designer-core/types.d.ts +326 -326
  77. package/templates/node_modules/version.txt +1 -1
  78. package/templates/simple-example.ts +103 -103
  79. package/templates//345/244/215/346/235/202/346/250/241/345/235/227/346/267/273/345/212/240-detail/345/220/216/347/274/200 +0 -2
@@ -0,0 +1,2 @@
1
+ import type { DomainDesignInfoProvider } from './types'
2
+ export declare function createInfoProvider(designId: string): DomainDesignInfoProvider
@@ -0,0 +1,2 @@
1
+ import { DomainDesignNoteProvider } from './types'
2
+ export declare function createNoteProvider(_designCode: string): DomainDesignNoteProvider
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "@ddd-tool/domain-designer-core",
3
+ "private": false,
4
+ "version": "0.3.2",
5
+ "type": "module",
6
+ "main": "./index.js",
7
+ "module": "index.js",
8
+ "license": "Apache-2.0",
9
+ "author": {
10
+ "name": "AlphaFoxz",
11
+ "url": "https://github.com/AlphaFoxz"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/ddd-tool/domain-designer-core-ts.git"
16
+ },
17
+ "bugs": {
18
+ "url": "https://github.com/ddd-tool/domain-designer-core-ts/issues"
19
+ },
20
+ "homepage": "https://github.com/ddd-tool/domain-designer-core-ts#readme"
21
+ }
@@ -0,0 +1,2 @@
1
+ import { DomainDesignPolicyProvider } from './types'
2
+ export declare function createPolicyProvider(designId: string): DomainDesignPolicyProvider
@@ -0,0 +1,2 @@
1
+ import { DomainDesignReadModelProvider } from './types'
2
+ export declare function createReadModelProvider(designId: string): DomainDesignReadModelProvider
@@ -0,0 +1,2 @@
1
+ import { DomainDesignServiceProvider } from './types'
2
+ export declare function createServiceProvider(designId: string): DomainDesignServiceProvider
@@ -0,0 +1,2 @@
1
+ import { DomainDesignSystemProvider } from './types'
2
+ export declare function createSystemProvider(designId: string): DomainDesignSystemProvider
@@ -0,0 +1,558 @@
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 declare const DomainDesignRule: Readonly<{
10
+ Note: 'Note'
11
+ Info: 'Info'
12
+ Actor: 'Actor'
13
+ Command: 'Command'
14
+ FacadeCommand: 'FacadeCommand'
15
+ Event: 'Event'
16
+ Agg: 'Agg'
17
+ System: 'System'
18
+ Policy: 'Policy'
19
+ Service: 'Service'
20
+ ReadModel: 'ReadModel'
21
+ }>
22
+ export type DomainDesignRule = Enum<typeof DomainDesignRule>
23
+ export interface DomainDesignObject {
24
+ readonly _attributes: {
25
+ readonly rule: DomainDesignRule
26
+ readonly __id: string
27
+ readonly name: string
28
+ readonly note?: DomainDesignNote
29
+ }
30
+ }
31
+ export type DomainDesignNoteProvider = {
32
+ (temp: undefined): undefined
33
+ (temp: string): DomainDesignNote
34
+ (temp: DomainDesignNote): DomainDesignNote
35
+ (temp: TemplateStringsArray, ...values: DomainDesignNoteInject[]): DomainDesignNote
36
+ }
37
+ export type DomainDesignNote = Readonly<{
38
+ readonly _attributes: {
39
+ rule: Extract<DomainDesignRule, 'Note'>
40
+ readonly template: TemplateStringsArray
41
+ readonly inject: DomainDesignNoteInject[]
42
+ }
43
+ }>
44
+ export type DomainDesignNoteInject =
45
+ | DomainDesignInfo<any, any>
46
+ | DomainDesignCommand<any>
47
+ | DomainDesignFacadeCommand<any>
48
+ | DomainDesignEvent<any>
49
+ | DomainDesignAgg<any>
50
+ | DomainDesignActor
51
+ | DomainDesignSystem
52
+ | DomainDesignPolicy
53
+ | DomainDesignService
54
+ export type DomainDesignInfoProvider = () => {
55
+ document<NAME extends string>(
56
+ name: NAME,
57
+ note?: string | DomainDesignNote,
58
+ ): DomainDesignInfo<'Document', NAME>
59
+ func<NAME extends string>(
60
+ name: NAME,
61
+ note?: string | DomainDesignNote,
62
+ ): DomainDesignInfo<'Function', NAME>
63
+ func<NAME extends string>(
64
+ name: NAME,
65
+ dependsOn: NonEmptyArray<
66
+ DomainDesignInfoFuncDependsOn | string | [string, string | DomainDesignNote]
67
+ >,
68
+ note?: string | DomainDesignNote,
69
+ ): DomainDesignInfo<'Function', NAME>
70
+ id<NAME extends string>(
71
+ name: NAME,
72
+ note?: string | DomainDesignNote,
73
+ ): DomainDesignInfo<'Id', NAME>
74
+ valueObj<NAME extends string>(
75
+ name: NAME,
76
+ note?: string | DomainDesignNote,
77
+ ): DomainDesignInfo<'ValueObject', NAME>
78
+ version<NAME extends string>(
79
+ name: NAME,
80
+ note?: string | DomainDesignNote,
81
+ ): DomainDesignInfo<'Version', NAME>
82
+ }
83
+ export type DomainDesignInfoType = 'Document' | 'Function' | 'Id' | 'ValueObject' | 'Version'
84
+ export type DomainDesignInfoSimplify<NAME extends string> = NAME | [NAME, string | DomainDesignNote]
85
+ export type DomainDesignInfoSubtype<TYPE extends DomainDesignInfoType> = TYPE extends
86
+ | 'Document'
87
+ | 'Id'
88
+ | 'Version'
89
+ | 'ValueObject'
90
+ ? 'None'
91
+ : TYPE extends 'Function'
92
+ ? DomainDesignInfoFuncDependsOn[]
93
+ : never
94
+ export interface DomainDesignInfo<
95
+ TYPE extends DomainDesignInfoType,
96
+ NAME extends string,
97
+ > extends DomainDesignObject {
98
+ readonly _attributes: {
99
+ readonly __id: string
100
+ readonly rule: Extract<DomainDesignRule, 'Info'>
101
+ readonly type: TYPE
102
+ readonly subtype: DomainDesignInfoSubtype<TYPE>
103
+ readonly name: NAME
104
+ readonly note?: DomainDesignNote
105
+ }
106
+ toFormat(): string
107
+ }
108
+ export type DomainDesignInfoFuncDependsOn = DomainDesignInfo<
109
+ Exclude<DomainDesignInfoType, 'Function'>,
110
+ string
111
+ >
112
+ export type DomainDesignInfoRecord = NonEmptyObject<
113
+ Record<string, DomainDesignInfo<DomainDesignInfoType, string>>
114
+ >
115
+ export type CustomInfo<G_NAME extends string> =
116
+ | DomainDesignInfo<DomainDesignInfoType, G_NAME>
117
+ | G_NAME
118
+ | [G_NAME, string | DomainDesignNote]
119
+ export type CustomInfoArrayToInfoObject<
120
+ ARR extends Array<DomainDesignInfo<any, any> | string | [string, string | DomainDesignNote]>,
121
+ > = {
122
+ [K in ARR[number] as K extends DomainDesignInfo<any, infer U>
123
+ ? U
124
+ : K extends string
125
+ ? K
126
+ : K extends [infer U, any]
127
+ ? U
128
+ : never]: K extends DomainDesignInfo<any, any>
129
+ ? K
130
+ : K extends string
131
+ ? DomainDesignInfo<'ValueObject', K>
132
+ : K extends [infer U extends string, any]
133
+ ? DomainDesignInfo<'ValueObject', U>
134
+ : never
135
+ }
136
+ export type DomainDesignActorProvider = {
137
+ (name: string, note?: string | DomainDesignNote): DomainDesignActor
138
+ }
139
+ export interface DomainDesignActor extends DomainDesignObject {
140
+ readonly _attributes: {
141
+ readonly __id: string
142
+ readonly rule: Extract<DomainDesignRule, 'Actor'>
143
+ readonly name: string
144
+ readonly note?: DomainDesignNote
145
+ }
146
+ command<COMMAND extends DomainDesignCommand<any>>(command: COMMAND): COMMAND
147
+ command<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(
148
+ name: string,
149
+ infos: ARR,
150
+ note?: string | DomainDesignNote,
151
+ ): DomainDesignCommand<CustomInfoArrayToInfoObject<ARR>>
152
+ facadeCmd<FACADECMD extends DomainDesignFacadeCommand<any>>(command: FACADECMD): FACADECMD
153
+ facadeCmd<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(
154
+ name: string,
155
+ infos: ARR,
156
+ note?: string | DomainDesignNote,
157
+ ): DomainDesignFacadeCommand<CustomInfoArrayToInfoObject<ARR>>
158
+ readModel<READ_MODEL extends DomainDesignReadModel<any>>(readModel: READ_MODEL): READ_MODEL
159
+ readModel<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(
160
+ name: string,
161
+ infos: ARR | NonEmptyInitFunc<() => ARR>,
162
+ ): DomainDesignReadModel<CustomInfoArrayToInfoObject<ARR>>
163
+ toFormat(): string
164
+ }
165
+ export type DomainDesignCommandProvider = {
166
+ <G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(
167
+ name: string,
168
+ infos: ARR | NonEmptyInitFunc<() => ARR>,
169
+ note?: string | DomainDesignNote,
170
+ ): DomainDesignCommand<CustomInfoArrayToInfoObject<ARR>>
171
+ }
172
+ export interface DomainDesignCommand<
173
+ INFOS extends DomainDesignInfoRecord,
174
+ > extends DomainDesignObject {
175
+ readonly _attributes: {
176
+ readonly __id: string
177
+ readonly rule: Extract<DomainDesignRule, 'Command'>
178
+ readonly name: string
179
+ readonly infos: INFOS
180
+ readonly note?: DomainDesignNote
181
+ }
182
+ readonly inner: INFOS
183
+ agg<AGG extends DomainDesignAgg<any>>(agg: AGG): AGG
184
+ agg<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(
185
+ name: string,
186
+ agg: ARR,
187
+ note?: string | DomainDesignNote,
188
+ ): DomainDesignAgg<CustomInfoArrayToInfoObject<ARR>>
189
+ toFormat(): string
190
+ }
191
+ export type DomainDesignFacadeCommandProvider = {
192
+ <G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(
193
+ name: string,
194
+ infos: ARR | NonEmptyInitFunc<() => ARR>,
195
+ note?: string | DomainDesignNote,
196
+ ): DomainDesignFacadeCommand<CustomInfoArrayToInfoObject<ARR>>
197
+ }
198
+ export interface DomainDesignFacadeCommand<
199
+ INFOS extends DomainDesignInfoRecord,
200
+ > extends DomainDesignObject {
201
+ readonly _attributes: {
202
+ readonly __id: string
203
+ readonly rule: Extract<DomainDesignRule, 'FacadeCommand'>
204
+ readonly name: string
205
+ readonly infos: INFOS
206
+ readonly note?: DomainDesignNote
207
+ }
208
+ readonly inner: INFOS
209
+ agg<AGG extends DomainDesignAgg<any>>(agg: AGG): AGG
210
+ agg<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(
211
+ name: string,
212
+ agg: ARR,
213
+ note?: string | DomainDesignNote,
214
+ ): DomainDesignAgg<CustomInfoArrayToInfoObject<ARR>>
215
+ service(service: DomainDesignService): DomainDesignService
216
+ service(name: string, note?: string | DomainDesignNote): DomainDesignService
217
+ toFormat(): string
218
+ }
219
+ export type DomainDesignEventProvider = {
220
+ <G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(
221
+ name: string,
222
+ infos: ARR | NonEmptyInitFunc<() => ARR>,
223
+ note?: string | DomainDesignNote,
224
+ ): DomainDesignEvent<CustomInfoArrayToInfoObject<ARR>>
225
+ }
226
+ export interface DomainDesignEvent<
227
+ INFOS extends DomainDesignInfoRecord,
228
+ > extends DomainDesignObject {
229
+ readonly _attributes: {
230
+ readonly __id: string
231
+ readonly rule: Extract<DomainDesignRule, 'Event'>
232
+ readonly name: string
233
+ readonly infos: INFOS
234
+ readonly note?: DomainDesignNote
235
+ }
236
+ readonly inner: INFOS
237
+ policy(policy: DomainDesignPolicy): DomainDesignPolicy
238
+ policy(name: string, note?: string | DomainDesignNote): DomainDesignPolicy
239
+ system(system: DomainDesignSystem): DomainDesignSystem
240
+ system(name: string, note?: string | DomainDesignNote): DomainDesignSystem
241
+ readModel<READ_MODEL extends DomainDesignReadModel<any>>(readModel: READ_MODEL): READ_MODEL
242
+ readModel<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(
243
+ name: string,
244
+ infos: ARR | NonEmptyInitFunc<() => ARR>,
245
+ ): DomainDesignReadModel<CustomInfoArrayToInfoObject<ARR>>
246
+ toFormat(): string
247
+ }
248
+ export type DomainDesignAggProvider = {
249
+ <G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(
250
+ name: string,
251
+ infos: ARR | NonEmptyInitFunc<() => ARR>,
252
+ note?: string | DomainDesignNote,
253
+ ): DomainDesignAgg<CustomInfoArrayToInfoObject<ARR>>
254
+ }
255
+ export interface DomainDesignAgg<INFOS extends DomainDesignInfoRecord> extends DomainDesignObject {
256
+ readonly _attributes: {
257
+ readonly __id: string
258
+ readonly rule: Extract<DomainDesignRule, 'Agg'>
259
+ readonly name: string
260
+ readonly infos: INFOS
261
+ readonly note?: DomainDesignNote
262
+ }
263
+ readonly inner: INFOS
264
+ event<EVENT extends DomainDesignEvent<any>>(event: EVENT): EVENT
265
+ event<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(
266
+ name: string,
267
+ infos: ARR,
268
+ note?: string | DomainDesignNote,
269
+ ): DomainDesignEvent<CustomInfoArrayToInfoObject<ARR>>
270
+ toFormat(): string
271
+ }
272
+ export type DomainDesignPolicyProvider = {
273
+ (name: string, note?: string | DomainDesignNote): DomainDesignPolicy
274
+ }
275
+ export interface DomainDesignPolicy extends DomainDesignObject {
276
+ readonly _attributes: {
277
+ readonly __id: string
278
+ readonly rule: Extract<DomainDesignRule, 'Policy'>
279
+ readonly name: string
280
+ readonly note?: DomainDesignNote
281
+ }
282
+ command<COMMAND extends DomainDesignCommand<any>>(command: COMMAND): COMMAND
283
+ command<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(
284
+ name: string,
285
+ infos: ARR,
286
+ note?: string | DomainDesignNote,
287
+ ): DomainDesignCommand<CustomInfoArrayToInfoObject<ARR>>
288
+ facadeCmd<FACADECMD extends DomainDesignFacadeCommand<any>>(command: FACADECMD): FACADECMD
289
+ facadeCmd<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(
290
+ name: string,
291
+ infos: ARR,
292
+ note?: string | DomainDesignNote,
293
+ ): DomainDesignFacadeCommand<CustomInfoArrayToInfoObject<ARR>>
294
+ service(service: DomainDesignService): DomainDesignService
295
+ service(name: string, note?: string | DomainDesignNote): DomainDesignService
296
+ toFormat(): string
297
+ }
298
+ export type DomainDesignSystemProvider = {
299
+ (name: string, note?: string | DomainDesignNote): DomainDesignSystem
300
+ }
301
+ export interface DomainDesignSystem extends DomainDesignObject {
302
+ readonly _attributes: {
303
+ readonly __id: string
304
+ readonly rule: Extract<DomainDesignRule, 'System'>
305
+ readonly name: string
306
+ readonly note?: DomainDesignNote
307
+ }
308
+ command<COMMAND extends DomainDesignCommand<any>>(command: COMMAND): COMMAND
309
+ command<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(
310
+ name: string,
311
+ infos: ARR,
312
+ note?: string | DomainDesignNote,
313
+ ): DomainDesignCommand<CustomInfoArrayToInfoObject<ARR>>
314
+ facadeCmd<FACADECMD extends DomainDesignFacadeCommand<any>>(facadeCmd: FACADECMD): FACADECMD
315
+ facadeCmd<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(
316
+ name: string,
317
+ infos: ARR,
318
+ note?: string | DomainDesignNote,
319
+ ): DomainDesignFacadeCommand<CustomInfoArrayToInfoObject<ARR>>
320
+ event<EVENT extends DomainDesignEvent<any>>(event: EVENT): EVENT
321
+ event<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(
322
+ name: string,
323
+ infos: ARR,
324
+ note?: string | DomainDesignNote,
325
+ ): DomainDesignEvent<CustomInfoArrayToInfoObject<ARR>>
326
+ toFormat(): string
327
+ }
328
+ export type DomainDesignServiceProvider = (
329
+ name: string,
330
+ note?: string | DomainDesignNote,
331
+ ) => DomainDesignService
332
+ export interface DomainDesignService extends DomainDesignObject {
333
+ readonly _attributes: {
334
+ readonly __id: string
335
+ readonly rule: Extract<DomainDesignRule, 'Service'>
336
+ readonly name: string
337
+ readonly note?: DomainDesignNote
338
+ }
339
+ command<COMMAND extends DomainDesignCommand<any>>(command: COMMAND): COMMAND
340
+ command<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(
341
+ name: string,
342
+ infos: ARR,
343
+ note?: string | DomainDesignNote,
344
+ ): DomainDesignCommand<CustomInfoArrayToInfoObject<ARR>>
345
+ facadeCmd<FACADECMD extends DomainDesignFacadeCommand<any>>(facadeCmd: FACADECMD): FACADECMD
346
+ facadeCmd<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(
347
+ name: string,
348
+ infos: ARR,
349
+ note?: string | DomainDesignNote,
350
+ ): DomainDesignFacadeCommand<CustomInfoArrayToInfoObject<ARR>>
351
+ agg<AGG extends DomainDesignAgg<any>>(agg: AGG): AGG
352
+ agg<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(
353
+ name: string,
354
+ agg: ARR,
355
+ note?: string | DomainDesignNote,
356
+ ): DomainDesignAgg<CustomInfoArrayToInfoObject<ARR>>
357
+ toFormat(): string
358
+ }
359
+ export type DomainDesignReadModelProvider = {
360
+ <G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(
361
+ name: string,
362
+ infos: ARR | NonEmptyInitFunc<() => ARR>,
363
+ note?: string | DomainDesignNote,
364
+ ): DomainDesignReadModel<CustomInfoArrayToInfoObject<ARR>>
365
+ }
366
+ export interface DomainDesignReadModel<
367
+ INFOS extends DomainDesignInfoRecord,
368
+ > extends DomainDesignObject {
369
+ readonly _attributes: {
370
+ readonly __id: string
371
+ readonly rule: Extract<DomainDesignRule, 'ReadModel'>
372
+ readonly name: string
373
+ readonly infos: INFOS
374
+ readonly note?: DomainDesignNote
375
+ }
376
+ readonly inner: INFOS
377
+ toFormat(): string
378
+ }
379
+ export type DomainDesignOptions = {
380
+ moduleName?: string
381
+ ignoreValueObjects?: string[]
382
+ __toFormatType?: 'BngleBrackets' | 'JSON' | 'JSONPretty'
383
+ }
384
+ export type NonEmptyArray<T> = [T, ...T[]]
385
+ export type NonEmptyObject<T extends object> = keyof T extends never ? never : T
386
+ export type NonEmptyInitFunc<T extends () => object> = keyof ReturnType<T> extends never ? never : T
387
+ export declare function isDomainDesignInfo(param: any): param is DomainDesignInfo<any, any>
388
+ export declare function isDomainDesignInfoFunc<NAME extends string>(
389
+ info: DomainDesignInfo<DomainDesignInfoType, NAME>,
390
+ ): info is DomainDesignInfo<'Function', NAME>
391
+ export declare function isDomainDesignActor(param: any): param is DomainDesignActor
392
+ export declare function isDomainDesignAgg(param: any): param is DomainDesignAgg<any>
393
+ export declare function isDomainDesignCommand(param: any): param is DomainDesignCommand<any>
394
+ export declare function isDomainDesignFacadeCommand(
395
+ param: any,
396
+ ): param is DomainDesignFacadeCommand<any>
397
+ export declare function isDomainDesignEvent(param: any): param is DomainDesignEvent<any>
398
+ export declare function isDomainDesignPolicy(param: any): param is DomainDesignPolicy
399
+ export declare function isDomainDesignReadModel(param: any): param is DomainDesignReadModel<any>
400
+ export declare function isDomainDesignService(param: any): param is DomainDesignService
401
+ export declare function isDomainDesignSystem(param: any): param is DomainDesignSystem
402
+ export declare function isAnyDomainDesignObject(param: any): param is DomainDesignObject
403
+ export declare function isDomainDesigner(param: any): param is DomainDesigner
404
+ export type DomainDesigner = {
405
+ startWorkflow: (name: string) => string
406
+ defineUserStory: (name: string, workflowNames: NonEmptyArray<string>) => void
407
+ note: DomainDesignNoteProvider
408
+ info: {
409
+ document<NAME extends string>(
410
+ name: NAME,
411
+ note?: string | DomainDesignNote,
412
+ ): DomainDesignInfo<'Document', NAME>
413
+ func<NAME extends string>(
414
+ name: NAME,
415
+ note?: string | DomainDesignNote,
416
+ ): DomainDesignInfo<'Function', NAME>
417
+ func<NAME extends string>(
418
+ name: NAME,
419
+ dependsOn: NonEmptyArray<
420
+ DomainDesignInfoFuncDependsOn | string | [string, string | DomainDesignNote]
421
+ >,
422
+ note?: string | DomainDesignNote,
423
+ ): DomainDesignInfo<'Function', NAME>
424
+ id<NAME extends string>(
425
+ name: NAME,
426
+ note?: string | DomainDesignNote,
427
+ ): DomainDesignInfo<'Id', NAME>
428
+ valueObj<NAME extends string>(
429
+ name: NAME,
430
+ note?: string | DomainDesignNote,
431
+ ): DomainDesignInfo<'ValueObject', NAME>
432
+ version<NAME extends string>(
433
+ name: NAME,
434
+ note?: string | DomainDesignNote,
435
+ ): DomainDesignInfo<'Version', NAME>
436
+ }
437
+ actor: DomainDesignActorProvider
438
+ command: DomainDesignCommandProvider
439
+ facadeCmd: DomainDesignFacadeCommandProvider
440
+ agg: DomainDesignAggProvider
441
+ event: DomainDesignEventProvider
442
+ system: DomainDesignSystemProvider
443
+ policy: DomainDesignPolicyProvider
444
+ service: DomainDesignServiceProvider
445
+ readModel: DomainDesignReadModelProvider
446
+ _getContext: () => {
447
+ startWorkflow(name: string): string
448
+ defineUserStory(name: string, workflowNames: NonEmptyArray<string>): void
449
+ linkTo(
450
+ srcRule:
451
+ | 'Info'
452
+ | 'Actor'
453
+ | 'Command'
454
+ | 'FacadeCommand'
455
+ | 'Agg'
456
+ | 'Event'
457
+ | 'Policy'
458
+ | 'Service'
459
+ | 'System'
460
+ | 'ReadModel',
461
+ srcId: string,
462
+ targetRule:
463
+ | 'Info'
464
+ | 'Actor'
465
+ | 'Command'
466
+ | 'FacadeCommand'
467
+ | 'Agg'
468
+ | 'Event'
469
+ | 'Policy'
470
+ | 'Service'
471
+ | 'System'
472
+ | 'ReadModel',
473
+ targetId: string,
474
+ linkType?: import('./common').LinkType,
475
+ ): void
476
+ getDesignerId(): string
477
+ getDesignerOptions(): Required<DomainDesignOptions>
478
+ getWorkflows(): Record<string, string[]>
479
+ getUserStories(): Record<string, string[]>
480
+ getLinks(): Record<string, import('./common').LinkType>
481
+ getIdMap(): Record<string, DomainDesignObject>
482
+ getAssociationMap(): Record<string, DomainObjectSet<DomainDesignObject>>
483
+ getCommands(): DomainDesignCommand<any>[]
484
+ getFacadeCommands(): DomainDesignFacadeCommand<any>[]
485
+ getActors(): DomainDesignActor[]
486
+ getEvents(): DomainDesignEvent<any>[]
487
+ getPolicies(): DomainDesignPolicy[]
488
+ getServices(): DomainDesignService[]
489
+ getSystems(): DomainDesignSystem[]
490
+ getAggs(): DomainDesignAgg<any>[]
491
+ getReadModels(): DomainDesignReadModel<any>[]
492
+ registerInfo(info: DomainDesignInfo<any, any>): void
493
+ registerCommand(command: DomainDesignCommand<any>): void
494
+ registerFacadeCommand(command: DomainDesignFacadeCommand<any>): void
495
+ registerActor(actor: DomainDesignActor): void
496
+ registerEvent(event: DomainDesignEvent<any>): void
497
+ registerPolicy(policy: DomainDesignPolicy): void
498
+ registerService(service: DomainDesignService): void
499
+ registerSystem(system: DomainDesignSystem): void
500
+ registerAgg(agg: DomainDesignAgg<any>): void
501
+ registerReadModel(readModel: DomainDesignReadModel<any>): void
502
+ customInfoArrToInfoObj<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(
503
+ arr: ARR,
504
+ ): CustomInfoArrayToInfoObject<ARR>
505
+ customInfoArrToInfoArr<G_NAME extends string, ARR extends NonEmptyArray<CustomInfo<G_NAME>>>(
506
+ arr: ARR,
507
+ ): DomainDesignInfo<DomainDesignInfoType, string>[]
508
+ toFormat<
509
+ OBJ extends {
510
+ _attributes: {
511
+ __id: string
512
+ name: string
513
+ }
514
+ },
515
+ >(
516
+ obj: OBJ,
517
+ ): string
518
+ createNote: DomainDesignNoteProvider
519
+ info: {
520
+ document<NAME extends string>(
521
+ name: NAME,
522
+ note?: string | DomainDesignNote,
523
+ ): DomainDesignInfo<'Document', NAME>
524
+ func<NAME extends string>(
525
+ name: NAME,
526
+ note?: string | DomainDesignNote,
527
+ ): DomainDesignInfo<'Function', NAME>
528
+ func<NAME extends string>(
529
+ name: NAME,
530
+ dependsOn: NonEmptyArray<
531
+ DomainDesignInfoFuncDependsOn | string | [string, string | DomainDesignNote]
532
+ >,
533
+ note?: string | DomainDesignNote,
534
+ ): DomainDesignInfo<'Function', NAME>
535
+ id<NAME extends string>(
536
+ name: NAME,
537
+ note?: string | DomainDesignNote,
538
+ ): DomainDesignInfo<'Id', NAME>
539
+ valueObj<NAME extends string>(
540
+ name: NAME,
541
+ note?: string | DomainDesignNote,
542
+ ): DomainDesignInfo<'ValueObject', NAME>
543
+ version<NAME extends string>(
544
+ name: NAME,
545
+ note?: string | DomainDesignNote,
546
+ ): DomainDesignInfo<'Version', NAME>
547
+ }
548
+ createPersion: DomainDesignActorProvider
549
+ createCommand: DomainDesignCommandProvider
550
+ createFacadeCommand: DomainDesignFacadeCommandProvider
551
+ createAgg: DomainDesignAggProvider
552
+ createEvent: DomainDesignEventProvider
553
+ createPolicy: DomainDesignPolicyProvider
554
+ createService: DomainDesignServiceProvider
555
+ createSystem: DomainDesignSystemProvider
556
+ createReadModel: DomainDesignReadModelProvider
557
+ }
558
+ }
@@ -1,25 +1,25 @@
1
1
  {
2
- "hash": "7d85a8f4",
3
- "configHash": "4749372a",
4
- "lockfileHash": "0b6433a6",
5
- "browserHash": "148b3554",
2
+ "hash": "6258a39b",
3
+ "configHash": "4731d055",
4
+ "lockfileHash": "2041c8ef",
5
+ "browserHash": "a90cdbb1",
6
6
  "optimized": {
7
7
  "primevue/button": {
8
8
  "src": "../../../../../node_modules/primevue/button/index.mjs",
9
9
  "file": "primevue_button.js",
10
- "fileHash": "17016d8b",
10
+ "fileHash": "a7a9f415",
11
11
  "needsInterop": false
12
12
  },
13
13
  "primevue/dock": {
14
14
  "src": "../../../../../node_modules/primevue/dock/index.mjs",
15
15
  "file": "primevue_dock.js",
16
- "fileHash": "126be8d6",
16
+ "fileHash": "a1c740ab",
17
17
  "needsInterop": false
18
18
  },
19
19
  "vue": {
20
20
  "src": "../../../../../node_modules/vue/dist/vue.runtime.esm-bundler.js",
21
21
  "file": "vue.js",
22
- "fileHash": "21498892",
22
+ "fileHash": "21900bd3",
23
23
  "needsInterop": false
24
24
  }
25
25
  },
@@ -1,21 +1,19 @@
1
- {
2
- "name": "playground",
3
- "version": "0.3.0",
4
- "private": true,
5
- "description": "",
6
- "type": "module",
7
- "scripts": {
8
- "dev": "vite",
9
- "test": "exit 0",
10
- "build": "exit 0",
11
- "verify": "vue-tsc -p ./tsconfig.json"
12
- },
13
- "devDependencies": {
14
- "@ddd-tool/domain-designer-core": "workspace:^",
15
- "@ddd-tool/domain-designer-ui-component": "workspace:^",
16
- "@primeuix/themes": "^2.0.3",
17
- "primeicons": "^7.0.0",
18
- "primevue": "^4.5.4",
19
- "vue": "^3.5.27"
20
- }
21
- }
1
+ {
2
+ "name": "playground",
3
+ "version": "0.3.2",
4
+ "private": true,
5
+ "description": "",
6
+ "type": "module",
7
+ "scripts": {
8
+ "dev": "vite",
9
+ "test": "exit 0",
10
+ "build": "exit 0",
11
+ "verify": "vue-tsc -p ./tsconfig.json"
12
+ },
13
+ "devDependencies": {
14
+ "@primeuix/themes": "^2.0.3",
15
+ "primeicons": "^7.0.0",
16
+ "primevue": "^4.5.4",
17
+ "vue": "^3.5.27"
18
+ }
19
+ }