@likec4/generators 1.38.1 → 1.39.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/dist/model/generate-aux.js +1 -1
- package/dist/react/generate-react-types.js +1 -1
- package/package.json +9 -5
- package/src/model/generate-aux.ts +2 -2
- package/src/react/generate-react-types.ts +1 -1
- package/src/__mocks__/data.ts +0 -463
- package/src/d2/__snapshots__/generate-d2.spec.ts.snap +0 -169
- package/src/d2/generate-d2.spec.ts +0 -102
- package/src/mmd/__snapshots__/generate-mmd.spec.ts.snap +0 -55
- package/src/mmd/generate-mmd.spec.ts +0 -23
- package/src/model/__snapshots__/_aux.generate-valid-code.snap +0 -56
- package/src/model/__snapshots__/likec4.computed-model.snap +0 -1150
- package/src/model/__snapshots__/likec4.parsed-model.snap +0 -654
- package/src/model/generate-aux.spec.ts +0 -65
- package/src/model/generate-likec4-model.spec.ts +0 -184
- package/src/puml/__snapshots__/generate-puml.spec.ts.snap +0 -184
- package/src/puml/generate-puml.spec.ts +0 -26
- package/src/react/__snapshots__/valid-code.snap +0 -111
- package/src/react/generate-react-types.spec.ts +0 -67
- package/src/views-data-ts/__snapshots__/generate-views-data.spec.ts.snap +0 -83
- package/src/views-data-ts/generate-views-data.spec.ts +0 -15
|
@@ -1,654 +0,0 @@
|
|
|
1
|
-
/* prettier-ignore-start */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
|
|
4
|
-
/******************************************************************************
|
|
5
|
-
* This file was generated
|
|
6
|
-
* DO NOT EDIT MANUALLY!
|
|
7
|
-
******************************************************************************/
|
|
8
|
-
|
|
9
|
-
import { LikeC4Model } from '@likec4/core/model'
|
|
10
|
-
import type { ParsedLikeC4ModelData } from '@likec4/core/types'
|
|
11
|
-
import type { Aux, SpecAux } from '@likec4/core/types';
|
|
12
|
-
|
|
13
|
-
export type $Specs = SpecAux<
|
|
14
|
-
// Element kinds
|
|
15
|
-
| "component"
|
|
16
|
-
| "mobile"
|
|
17
|
-
| "person"
|
|
18
|
-
| "system"
|
|
19
|
-
| "webapp",
|
|
20
|
-
// Deployment kinds
|
|
21
|
-
| "env"
|
|
22
|
-
| "node"
|
|
23
|
-
| "zone",
|
|
24
|
-
// Relationship kinds
|
|
25
|
-
never,
|
|
26
|
-
// Tags
|
|
27
|
-
| "external"
|
|
28
|
-
| "internal",
|
|
29
|
-
// Metadata keys
|
|
30
|
-
| "key1"
|
|
31
|
-
>
|
|
32
|
-
|
|
33
|
-
export type $Aux = Aux<
|
|
34
|
-
"parsed",
|
|
35
|
-
// Elements
|
|
36
|
-
| "aws"
|
|
37
|
-
| "cloud"
|
|
38
|
-
| "customer"
|
|
39
|
-
| "email"
|
|
40
|
-
| "aws.rds"
|
|
41
|
-
| "aws.s3"
|
|
42
|
-
| "cloud.auth"
|
|
43
|
-
| "cloud.backend"
|
|
44
|
-
| "cloud.frontend"
|
|
45
|
-
| "cloud.media"
|
|
46
|
-
| "cloud.backend.api"
|
|
47
|
-
| "cloud.backend.graphql"
|
|
48
|
-
| "cloud.frontend.dashboard"
|
|
49
|
-
| "cloud.frontend.mobile",
|
|
50
|
-
// Deployments
|
|
51
|
-
| "customer"
|
|
52
|
-
| "prod"
|
|
53
|
-
| "customer.instance"
|
|
54
|
-
| "prod.eu"
|
|
55
|
-
| "prod.us"
|
|
56
|
-
| "prod.eu.db"
|
|
57
|
-
| "prod.eu.media"
|
|
58
|
-
| "prod.eu.zone1"
|
|
59
|
-
| "prod.eu.zone2"
|
|
60
|
-
| "prod.us.db"
|
|
61
|
-
| "prod.eu.zone1.api"
|
|
62
|
-
| "prod.eu.zone1.ui"
|
|
63
|
-
| "prod.eu.zone2.api"
|
|
64
|
-
| "prod.eu.zone2.ui",
|
|
65
|
-
// Views
|
|
66
|
-
| "cloud"
|
|
67
|
-
| "index"
|
|
68
|
-
| "prod",
|
|
69
|
-
// Project ID
|
|
70
|
-
"from-builder",
|
|
71
|
-
$Specs
|
|
72
|
-
>
|
|
73
|
-
|
|
74
|
-
export type $ElementId = $Aux['ElementId']
|
|
75
|
-
export type $DeploymentId = $Aux['DeploymentId']
|
|
76
|
-
export type $ViewId = $Aux['ViewId']
|
|
77
|
-
|
|
78
|
-
export type $ElementKind = $Aux['ElementKind']
|
|
79
|
-
export type $RelationKind = $Aux['RelationKind']
|
|
80
|
-
export type $DeploymentKind = $Aux['DeploymentKind']
|
|
81
|
-
export type $Tag = $Aux['Tag']
|
|
82
|
-
export type $Tags = readonly $Aux['Tag'][]
|
|
83
|
-
export type $MetadataKey = $Aux['MetadataKey']
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
export const likec4model: LikeC4Model<$Aux> = new LikeC4Model(<ParsedLikeC4ModelData<$Aux>>({
|
|
87
|
-
_stage: 'parsed',
|
|
88
|
-
projectId: 'from-builder',
|
|
89
|
-
project: {
|
|
90
|
-
id: 'from-builder',
|
|
91
|
-
},
|
|
92
|
-
specification: {
|
|
93
|
-
elements: {
|
|
94
|
-
person: {
|
|
95
|
-
style: {
|
|
96
|
-
shape: 'person',
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
system: {},
|
|
100
|
-
component: {},
|
|
101
|
-
webapp: {
|
|
102
|
-
style: {
|
|
103
|
-
shape: 'browser',
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
mobile: {
|
|
107
|
-
style: {
|
|
108
|
-
shape: 'mobile',
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
deployments: {
|
|
113
|
-
env: {},
|
|
114
|
-
zone: {},
|
|
115
|
-
node: {},
|
|
116
|
-
},
|
|
117
|
-
relationships: {},
|
|
118
|
-
tags: {
|
|
119
|
-
internal: {
|
|
120
|
-
color: 'primary',
|
|
121
|
-
},
|
|
122
|
-
external: {
|
|
123
|
-
color: 'primary',
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
metadataKeys: [
|
|
127
|
-
'key1',
|
|
128
|
-
],
|
|
129
|
-
customColors: {},
|
|
130
|
-
},
|
|
131
|
-
elements: {
|
|
132
|
-
customer: {
|
|
133
|
-
id: 'customer',
|
|
134
|
-
kind: 'person',
|
|
135
|
-
title: 'customer',
|
|
136
|
-
technology: null,
|
|
137
|
-
tags: [],
|
|
138
|
-
color: 'primary',
|
|
139
|
-
shape: 'person',
|
|
140
|
-
style: {},
|
|
141
|
-
links: null,
|
|
142
|
-
},
|
|
143
|
-
cloud: {
|
|
144
|
-
id: 'cloud',
|
|
145
|
-
kind: 'system',
|
|
146
|
-
title: 'cloud',
|
|
147
|
-
technology: null,
|
|
148
|
-
tags: [],
|
|
149
|
-
color: 'primary',
|
|
150
|
-
shape: 'rectangle',
|
|
151
|
-
style: {},
|
|
152
|
-
links: null,
|
|
153
|
-
},
|
|
154
|
-
'cloud.frontend': {
|
|
155
|
-
id: 'cloud.frontend',
|
|
156
|
-
kind: 'component',
|
|
157
|
-
title: 'frontend',
|
|
158
|
-
technology: null,
|
|
159
|
-
tags: [],
|
|
160
|
-
color: 'primary',
|
|
161
|
-
shape: 'rectangle',
|
|
162
|
-
style: {},
|
|
163
|
-
links: null,
|
|
164
|
-
},
|
|
165
|
-
'cloud.frontend.dashboard': {
|
|
166
|
-
id: 'cloud.frontend.dashboard',
|
|
167
|
-
kind: 'webapp',
|
|
168
|
-
title: 'dashboard',
|
|
169
|
-
technology: null,
|
|
170
|
-
tags: [],
|
|
171
|
-
color: 'primary',
|
|
172
|
-
shape: 'browser',
|
|
173
|
-
style: {},
|
|
174
|
-
links: null,
|
|
175
|
-
},
|
|
176
|
-
'cloud.frontend.mobile': {
|
|
177
|
-
id: 'cloud.frontend.mobile',
|
|
178
|
-
kind: 'mobile',
|
|
179
|
-
title: 'mobile',
|
|
180
|
-
technology: null,
|
|
181
|
-
tags: [],
|
|
182
|
-
color: 'primary',
|
|
183
|
-
shape: 'mobile',
|
|
184
|
-
style: {},
|
|
185
|
-
links: null,
|
|
186
|
-
},
|
|
187
|
-
'cloud.auth': {
|
|
188
|
-
id: 'cloud.auth',
|
|
189
|
-
kind: 'component',
|
|
190
|
-
title: 'auth',
|
|
191
|
-
technology: null,
|
|
192
|
-
tags: [],
|
|
193
|
-
color: 'primary',
|
|
194
|
-
shape: 'rectangle',
|
|
195
|
-
style: {},
|
|
196
|
-
links: null,
|
|
197
|
-
},
|
|
198
|
-
'cloud.backend': {
|
|
199
|
-
id: 'cloud.backend',
|
|
200
|
-
kind: 'component',
|
|
201
|
-
title: 'backend',
|
|
202
|
-
technology: null,
|
|
203
|
-
tags: [
|
|
204
|
-
'external',
|
|
205
|
-
],
|
|
206
|
-
color: 'primary',
|
|
207
|
-
shape: 'rectangle',
|
|
208
|
-
style: {},
|
|
209
|
-
links: null,
|
|
210
|
-
metadata: {
|
|
211
|
-
key1: 'value1',
|
|
212
|
-
},
|
|
213
|
-
},
|
|
214
|
-
'cloud.backend.api': {
|
|
215
|
-
id: 'cloud.backend.api',
|
|
216
|
-
kind: 'component',
|
|
217
|
-
title: 'api',
|
|
218
|
-
technology: null,
|
|
219
|
-
tags: [],
|
|
220
|
-
color: 'primary',
|
|
221
|
-
shape: 'rectangle',
|
|
222
|
-
style: {},
|
|
223
|
-
links: null,
|
|
224
|
-
},
|
|
225
|
-
'cloud.backend.graphql': {
|
|
226
|
-
id: 'cloud.backend.graphql',
|
|
227
|
-
kind: 'component',
|
|
228
|
-
title: 'graphql',
|
|
229
|
-
technology: null,
|
|
230
|
-
tags: [],
|
|
231
|
-
color: 'primary',
|
|
232
|
-
shape: 'rectangle',
|
|
233
|
-
style: {},
|
|
234
|
-
links: null,
|
|
235
|
-
},
|
|
236
|
-
'cloud.media': {
|
|
237
|
-
id: 'cloud.media',
|
|
238
|
-
kind: 'component',
|
|
239
|
-
title: 'media',
|
|
240
|
-
technology: null,
|
|
241
|
-
tags: [
|
|
242
|
-
'internal',
|
|
243
|
-
],
|
|
244
|
-
color: 'primary',
|
|
245
|
-
shape: 'storage',
|
|
246
|
-
style: {},
|
|
247
|
-
links: null,
|
|
248
|
-
},
|
|
249
|
-
aws: {
|
|
250
|
-
id: 'aws',
|
|
251
|
-
kind: 'system',
|
|
252
|
-
title: 'aws',
|
|
253
|
-
technology: null,
|
|
254
|
-
tags: [],
|
|
255
|
-
color: 'primary',
|
|
256
|
-
shape: 'rectangle',
|
|
257
|
-
style: {},
|
|
258
|
-
links: null,
|
|
259
|
-
},
|
|
260
|
-
'aws.rds': {
|
|
261
|
-
id: 'aws.rds',
|
|
262
|
-
kind: 'component',
|
|
263
|
-
title: 'rds',
|
|
264
|
-
technology: null,
|
|
265
|
-
tags: [],
|
|
266
|
-
color: 'primary',
|
|
267
|
-
shape: 'storage',
|
|
268
|
-
style: {},
|
|
269
|
-
links: null,
|
|
270
|
-
},
|
|
271
|
-
'aws.s3': {
|
|
272
|
-
id: 'aws.s3',
|
|
273
|
-
kind: 'component',
|
|
274
|
-
title: 's3',
|
|
275
|
-
technology: null,
|
|
276
|
-
tags: [],
|
|
277
|
-
color: 'primary',
|
|
278
|
-
shape: 'storage',
|
|
279
|
-
style: {},
|
|
280
|
-
links: null,
|
|
281
|
-
metadata: {
|
|
282
|
-
key1: 'value2',
|
|
283
|
-
},
|
|
284
|
-
},
|
|
285
|
-
email: {
|
|
286
|
-
id: 'email',
|
|
287
|
-
kind: 'system',
|
|
288
|
-
title: 'email',
|
|
289
|
-
technology: null,
|
|
290
|
-
tags: [],
|
|
291
|
-
color: 'primary',
|
|
292
|
-
shape: 'rectangle',
|
|
293
|
-
style: {},
|
|
294
|
-
links: null,
|
|
295
|
-
},
|
|
296
|
-
},
|
|
297
|
-
relations: {
|
|
298
|
-
rel1: {
|
|
299
|
-
id: 'rel1',
|
|
300
|
-
source: {
|
|
301
|
-
model: 'customer',
|
|
302
|
-
},
|
|
303
|
-
target: {
|
|
304
|
-
model: 'cloud',
|
|
305
|
-
},
|
|
306
|
-
title: 'uses services',
|
|
307
|
-
},
|
|
308
|
-
rel2: {
|
|
309
|
-
id: 'rel2',
|
|
310
|
-
source: {
|
|
311
|
-
model: 'customer',
|
|
312
|
-
},
|
|
313
|
-
target: {
|
|
314
|
-
model: 'cloud.frontend.mobile',
|
|
315
|
-
},
|
|
316
|
-
title: 'opens mobile app',
|
|
317
|
-
},
|
|
318
|
-
rel3: {
|
|
319
|
-
id: 'rel3',
|
|
320
|
-
source: {
|
|
321
|
-
model: 'customer',
|
|
322
|
-
},
|
|
323
|
-
target: {
|
|
324
|
-
model: 'cloud.frontend.dashboard',
|
|
325
|
-
},
|
|
326
|
-
title: 'opens in browser',
|
|
327
|
-
},
|
|
328
|
-
rel4: {
|
|
329
|
-
id: 'rel4',
|
|
330
|
-
source: {
|
|
331
|
-
model: 'cloud.frontend.dashboard',
|
|
332
|
-
},
|
|
333
|
-
target: {
|
|
334
|
-
model: 'cloud.auth',
|
|
335
|
-
},
|
|
336
|
-
title: 'authenticates',
|
|
337
|
-
},
|
|
338
|
-
rel5: {
|
|
339
|
-
id: 'rel5',
|
|
340
|
-
source: {
|
|
341
|
-
model: 'cloud.frontend.dashboard',
|
|
342
|
-
},
|
|
343
|
-
target: {
|
|
344
|
-
model: 'cloud.backend.api',
|
|
345
|
-
},
|
|
346
|
-
title: 'fetches data',
|
|
347
|
-
},
|
|
348
|
-
rel6: {
|
|
349
|
-
id: 'rel6',
|
|
350
|
-
source: {
|
|
351
|
-
model: 'cloud.frontend.dashboard',
|
|
352
|
-
},
|
|
353
|
-
target: {
|
|
354
|
-
model: 'cloud.media',
|
|
355
|
-
},
|
|
356
|
-
title: 'fetches media',
|
|
357
|
-
},
|
|
358
|
-
rel7: {
|
|
359
|
-
id: 'rel7',
|
|
360
|
-
source: {
|
|
361
|
-
model: 'cloud.frontend.mobile',
|
|
362
|
-
},
|
|
363
|
-
target: {
|
|
364
|
-
model: 'cloud.auth',
|
|
365
|
-
},
|
|
366
|
-
title: 'authenticates',
|
|
367
|
-
},
|
|
368
|
-
rel8: {
|
|
369
|
-
id: 'rel8',
|
|
370
|
-
source: {
|
|
371
|
-
model: 'cloud.frontend.mobile',
|
|
372
|
-
},
|
|
373
|
-
target: {
|
|
374
|
-
model: 'cloud.backend.api',
|
|
375
|
-
},
|
|
376
|
-
title: 'fetches data',
|
|
377
|
-
},
|
|
378
|
-
rel9: {
|
|
379
|
-
id: 'rel9',
|
|
380
|
-
source: {
|
|
381
|
-
model: 'cloud.frontend.mobile',
|
|
382
|
-
},
|
|
383
|
-
target: {
|
|
384
|
-
model: 'cloud.media',
|
|
385
|
-
},
|
|
386
|
-
title: 'fetches media',
|
|
387
|
-
},
|
|
388
|
-
rel10: {
|
|
389
|
-
id: 'rel10',
|
|
390
|
-
source: {
|
|
391
|
-
model: 'cloud.backend.api',
|
|
392
|
-
},
|
|
393
|
-
target: {
|
|
394
|
-
model: 'cloud.auth',
|
|
395
|
-
},
|
|
396
|
-
title: 'authorizes',
|
|
397
|
-
},
|
|
398
|
-
rel11: {
|
|
399
|
-
id: 'rel11',
|
|
400
|
-
source: {
|
|
401
|
-
model: 'cloud.backend.api',
|
|
402
|
-
},
|
|
403
|
-
target: {
|
|
404
|
-
model: 'cloud.media',
|
|
405
|
-
},
|
|
406
|
-
title: 'uploads media',
|
|
407
|
-
},
|
|
408
|
-
rel12: {
|
|
409
|
-
id: 'rel12',
|
|
410
|
-
source: {
|
|
411
|
-
model: 'cloud.backend.api',
|
|
412
|
-
},
|
|
413
|
-
target: {
|
|
414
|
-
model: 'aws.rds',
|
|
415
|
-
},
|
|
416
|
-
title: 'reads/writes',
|
|
417
|
-
},
|
|
418
|
-
rel13: {
|
|
419
|
-
id: 'rel13',
|
|
420
|
-
source: {
|
|
421
|
-
model: 'cloud.backend.api',
|
|
422
|
-
},
|
|
423
|
-
target: {
|
|
424
|
-
model: 'email',
|
|
425
|
-
},
|
|
426
|
-
title: 'sends emails',
|
|
427
|
-
},
|
|
428
|
-
rel14: {
|
|
429
|
-
id: 'rel14',
|
|
430
|
-
source: {
|
|
431
|
-
model: 'cloud.media',
|
|
432
|
-
},
|
|
433
|
-
target: {
|
|
434
|
-
model: 'aws.s3',
|
|
435
|
-
},
|
|
436
|
-
title: 'uploads',
|
|
437
|
-
},
|
|
438
|
-
rel15: {
|
|
439
|
-
id: 'rel15',
|
|
440
|
-
source: {
|
|
441
|
-
model: 'email',
|
|
442
|
-
},
|
|
443
|
-
target: {
|
|
444
|
-
model: 'customer',
|
|
445
|
-
},
|
|
446
|
-
title: 'sends emails',
|
|
447
|
-
tags: [
|
|
448
|
-
'external',
|
|
449
|
-
],
|
|
450
|
-
metadata: {
|
|
451
|
-
key1: 'value3',
|
|
452
|
-
},
|
|
453
|
-
},
|
|
454
|
-
},
|
|
455
|
-
globals: {
|
|
456
|
-
predicates: {},
|
|
457
|
-
dynamicPredicates: {},
|
|
458
|
-
styles: {},
|
|
459
|
-
},
|
|
460
|
-
deployments: {
|
|
461
|
-
elements: {
|
|
462
|
-
customer: {
|
|
463
|
-
id: 'customer',
|
|
464
|
-
kind: 'node',
|
|
465
|
-
title: 'customer',
|
|
466
|
-
technology: null,
|
|
467
|
-
tags: null,
|
|
468
|
-
style: {
|
|
469
|
-
color: 'primary',
|
|
470
|
-
shape: 'rectangle',
|
|
471
|
-
},
|
|
472
|
-
},
|
|
473
|
-
'customer.instance': {
|
|
474
|
-
id: 'customer.instance',
|
|
475
|
-
element: 'customer',
|
|
476
|
-
},
|
|
477
|
-
prod: {
|
|
478
|
-
id: 'prod',
|
|
479
|
-
kind: 'env',
|
|
480
|
-
title: 'prod',
|
|
481
|
-
technology: null,
|
|
482
|
-
tags: null,
|
|
483
|
-
style: {
|
|
484
|
-
color: 'primary',
|
|
485
|
-
shape: 'rectangle',
|
|
486
|
-
},
|
|
487
|
-
},
|
|
488
|
-
'prod.eu': {
|
|
489
|
-
id: 'prod.eu',
|
|
490
|
-
kind: 'zone',
|
|
491
|
-
title: 'eu',
|
|
492
|
-
technology: null,
|
|
493
|
-
tags: null,
|
|
494
|
-
style: {
|
|
495
|
-
color: 'primary',
|
|
496
|
-
shape: 'rectangle',
|
|
497
|
-
},
|
|
498
|
-
},
|
|
499
|
-
'prod.eu.zone1': {
|
|
500
|
-
id: 'prod.eu.zone1',
|
|
501
|
-
kind: 'zone',
|
|
502
|
-
title: 'zone1',
|
|
503
|
-
technology: null,
|
|
504
|
-
tags: null,
|
|
505
|
-
style: {
|
|
506
|
-
color: 'primary',
|
|
507
|
-
shape: 'rectangle',
|
|
508
|
-
},
|
|
509
|
-
},
|
|
510
|
-
'prod.eu.zone1.ui': {
|
|
511
|
-
id: 'prod.eu.zone1.ui',
|
|
512
|
-
element: 'cloud.frontend.dashboard',
|
|
513
|
-
},
|
|
514
|
-
'prod.eu.zone1.api': {
|
|
515
|
-
id: 'prod.eu.zone1.api',
|
|
516
|
-
element: 'cloud.backend.api',
|
|
517
|
-
},
|
|
518
|
-
'prod.eu.zone2': {
|
|
519
|
-
id: 'prod.eu.zone2',
|
|
520
|
-
kind: 'zone',
|
|
521
|
-
title: 'zone2',
|
|
522
|
-
technology: null,
|
|
523
|
-
tags: null,
|
|
524
|
-
style: {
|
|
525
|
-
color: 'primary',
|
|
526
|
-
shape: 'rectangle',
|
|
527
|
-
},
|
|
528
|
-
},
|
|
529
|
-
'prod.eu.zone2.ui': {
|
|
530
|
-
id: 'prod.eu.zone2.ui',
|
|
531
|
-
element: 'cloud.frontend.dashboard',
|
|
532
|
-
},
|
|
533
|
-
'prod.eu.zone2.api': {
|
|
534
|
-
id: 'prod.eu.zone2.api',
|
|
535
|
-
element: 'cloud.backend.api',
|
|
536
|
-
},
|
|
537
|
-
'prod.eu.media': {
|
|
538
|
-
id: 'prod.eu.media',
|
|
539
|
-
element: 'cloud.media',
|
|
540
|
-
},
|
|
541
|
-
'prod.eu.db': {
|
|
542
|
-
id: 'prod.eu.db',
|
|
543
|
-
element: 'aws.rds',
|
|
544
|
-
},
|
|
545
|
-
'prod.us': {
|
|
546
|
-
id: 'prod.us',
|
|
547
|
-
kind: 'zone',
|
|
548
|
-
title: 'us',
|
|
549
|
-
technology: null,
|
|
550
|
-
tags: null,
|
|
551
|
-
style: {
|
|
552
|
-
color: 'primary',
|
|
553
|
-
shape: 'rectangle',
|
|
554
|
-
},
|
|
555
|
-
},
|
|
556
|
-
'prod.us.db': {
|
|
557
|
-
id: 'prod.us.db',
|
|
558
|
-
element: 'aws.rds',
|
|
559
|
-
},
|
|
560
|
-
},
|
|
561
|
-
relations: {
|
|
562
|
-
deploy_rel1: {
|
|
563
|
-
id: 'deploy_rel1',
|
|
564
|
-
source: {
|
|
565
|
-
deployment: 'prod.eu.db',
|
|
566
|
-
},
|
|
567
|
-
target: {
|
|
568
|
-
deployment: 'prod.us.db',
|
|
569
|
-
},
|
|
570
|
-
title: 'replicates',
|
|
571
|
-
},
|
|
572
|
-
},
|
|
573
|
-
},
|
|
574
|
-
views: {
|
|
575
|
-
index: {
|
|
576
|
-
id: 'index',
|
|
577
|
-
title: null,
|
|
578
|
-
description: null,
|
|
579
|
-
tags: [],
|
|
580
|
-
links: null,
|
|
581
|
-
_stage: 'parsed',
|
|
582
|
-
_type: 'element',
|
|
583
|
-
rules: [
|
|
584
|
-
{
|
|
585
|
-
include: [
|
|
586
|
-
{
|
|
587
|
-
wildcard: true,
|
|
588
|
-
},
|
|
589
|
-
],
|
|
590
|
-
},
|
|
591
|
-
],
|
|
592
|
-
},
|
|
593
|
-
cloud: {
|
|
594
|
-
id: 'cloud',
|
|
595
|
-
title: null,
|
|
596
|
-
description: null,
|
|
597
|
-
tags: [],
|
|
598
|
-
links: null,
|
|
599
|
-
_stage: 'parsed',
|
|
600
|
-
viewOf: 'cloud',
|
|
601
|
-
_type: 'element',
|
|
602
|
-
rules: [
|
|
603
|
-
{
|
|
604
|
-
include: [
|
|
605
|
-
{
|
|
606
|
-
wildcard: true,
|
|
607
|
-
},
|
|
608
|
-
],
|
|
609
|
-
},
|
|
610
|
-
{
|
|
611
|
-
include: [
|
|
612
|
-
{
|
|
613
|
-
ref: {
|
|
614
|
-
model: 'cloud.frontend.dashboard',
|
|
615
|
-
},
|
|
616
|
-
},
|
|
617
|
-
],
|
|
618
|
-
},
|
|
619
|
-
],
|
|
620
|
-
},
|
|
621
|
-
prod: {
|
|
622
|
-
id: 'prod',
|
|
623
|
-
title: 'prod',
|
|
624
|
-
description: null,
|
|
625
|
-
tags: [],
|
|
626
|
-
links: null,
|
|
627
|
-
_stage: 'parsed',
|
|
628
|
-
_type: 'deployment',
|
|
629
|
-
rules: [
|
|
630
|
-
{
|
|
631
|
-
include: [
|
|
632
|
-
{
|
|
633
|
-
ref: {
|
|
634
|
-
deployment: 'customer.instance',
|
|
635
|
-
},
|
|
636
|
-
},
|
|
637
|
-
],
|
|
638
|
-
},
|
|
639
|
-
{
|
|
640
|
-
include: [
|
|
641
|
-
{
|
|
642
|
-
ref: {
|
|
643
|
-
deployment: 'prod.eu.zone1.ui',
|
|
644
|
-
},
|
|
645
|
-
},
|
|
646
|
-
],
|
|
647
|
-
},
|
|
648
|
-
],
|
|
649
|
-
},
|
|
650
|
-
},
|
|
651
|
-
imports: {},
|
|
652
|
-
} as unknown))
|
|
653
|
-
|
|
654
|
-
/* prettier-ignore-end */
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { Builder } from '@likec4/core/builder'
|
|
2
|
-
import { describe, it } from 'vitest'
|
|
3
|
-
import { generateAux } from './generate-aux'
|
|
4
|
-
|
|
5
|
-
describe('generateAux', () => {
|
|
6
|
-
const m = Builder
|
|
7
|
-
.specification({
|
|
8
|
-
elements: {
|
|
9
|
-
actor: {},
|
|
10
|
-
system: {},
|
|
11
|
-
component: {},
|
|
12
|
-
},
|
|
13
|
-
deployments: {
|
|
14
|
-
env: {},
|
|
15
|
-
vm: {},
|
|
16
|
-
},
|
|
17
|
-
relationships: {
|
|
18
|
-
like: {},
|
|
19
|
-
dislike: {},
|
|
20
|
-
},
|
|
21
|
-
tags: {
|
|
22
|
-
tag1: {},
|
|
23
|
-
tag2: {},
|
|
24
|
-
},
|
|
25
|
-
metadataKeys: ['key1', 'key2'],
|
|
26
|
-
})
|
|
27
|
-
.model(({ actor, system, component, relTo }, _) =>
|
|
28
|
-
_(
|
|
29
|
-
actor('alice'),
|
|
30
|
-
actor('bob'),
|
|
31
|
-
system('cloud').with(
|
|
32
|
-
component('backend').with(
|
|
33
|
-
component('api'),
|
|
34
|
-
component('db'),
|
|
35
|
-
),
|
|
36
|
-
component('frontend'),
|
|
37
|
-
),
|
|
38
|
-
)
|
|
39
|
-
)
|
|
40
|
-
.deployment(({ env, vm, instanceOf }, _) =>
|
|
41
|
-
_(
|
|
42
|
-
env('prod').with(
|
|
43
|
-
vm('vm1'),
|
|
44
|
-
vm('vm2'),
|
|
45
|
-
),
|
|
46
|
-
env('dev').with(
|
|
47
|
-
vm('vm1'),
|
|
48
|
-
instanceOf('cloud.backend.api'),
|
|
49
|
-
),
|
|
50
|
-
)
|
|
51
|
-
)
|
|
52
|
-
// Test Element View
|
|
53
|
-
.views(({ view, $include }, _) =>
|
|
54
|
-
_(
|
|
55
|
-
// rules inside
|
|
56
|
-
view('view1', $include('cloud.backend')),
|
|
57
|
-
view('view2', $include('cloud.backend')),
|
|
58
|
-
)
|
|
59
|
-
)
|
|
60
|
-
|
|
61
|
-
it('generate valid code', async ({ expect }) => {
|
|
62
|
-
const aux = generateAux(m.toLikeC4Model())
|
|
63
|
-
await expect(aux).toMatchFileSnapshot('__snapshots__/_aux.generate-valid-code.snap')
|
|
64
|
-
})
|
|
65
|
-
})
|