@agilewallaby/c4-model 2.1.0 → 2.3.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/package.json +6 -5
- package/src/archetype.d.ts +30 -0
- package/src/buildModel.d.ts +20 -0
- package/src/component.d.ts +2 -1
- package/src/container.d.ts +5 -4
- package/src/core.d.ts +9 -4
- package/src/generateDiagrams.d.ts +1 -1
- package/src/index.cjs +952 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +396 -85
- package/src/model.d.ts +9 -18
- package/src/person.d.ts +3 -2
- package/src/softwareSystem.d.ts +6 -5
- package/src/structurizrDslWriter.d.ts +3 -0
package/src/model.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Group } from './core';
|
|
2
2
|
import { SoftwareSystem, SoftwareSystemDefinition } from './softwareSystem';
|
|
3
3
|
import { Person, PersonDefinition } from './person';
|
|
4
|
+
import { ElementArchetype } from './archetype';
|
|
4
5
|
export type CatalogKeyOf<TRoot, TModule> = {
|
|
5
6
|
[K in keyof TRoot]: TRoot[K] extends TModule ? K : never;
|
|
6
7
|
}[keyof TRoot];
|
|
@@ -11,10 +12,10 @@ export interface C4Module<TRoot, TLocal> {
|
|
|
11
12
|
buildRelationships(local: TLocal, dependencies: Dependencies<TRoot, TLocal>): void;
|
|
12
13
|
}
|
|
13
14
|
interface DefineSoftwareSystem {
|
|
14
|
-
defineSoftwareSystem(name: string,
|
|
15
|
+
defineSoftwareSystem(name: string, archetypeOrDef?: ElementArchetype | SoftwareSystemDefinition, override?: SoftwareSystemDefinition): SoftwareSystem;
|
|
15
16
|
}
|
|
16
17
|
interface DefinePerson {
|
|
17
|
-
definePerson(name: string,
|
|
18
|
+
definePerson(name: string, archetypeOrDef?: ElementArchetype | PersonDefinition, override?: PersonDefinition): Person;
|
|
18
19
|
}
|
|
19
20
|
export declare class ModelGroup extends Group implements DefineSoftwareSystem, DefinePerson {
|
|
20
21
|
readonly name: string;
|
|
@@ -22,14 +23,14 @@ export declare class ModelGroup extends Group implements DefineSoftwareSystem, D
|
|
|
22
23
|
private softwareSystems;
|
|
23
24
|
private people;
|
|
24
25
|
constructor(name: string, model: DefineSoftwareSystem & DefinePerson);
|
|
25
|
-
defineSoftwareSystem(name: string,
|
|
26
|
-
definePerson(name: string,
|
|
26
|
+
defineSoftwareSystem(name: string, archetypeOrDef?: ElementArchetype | SoftwareSystemDefinition, override?: SoftwareSystemDefinition): SoftwareSystem;
|
|
27
|
+
definePerson(name: string, archetypeOrDef?: ElementArchetype | PersonDefinition, override?: PersonDefinition): Person;
|
|
27
28
|
getSoftwareSystems(): ReadonlyArray<SoftwareSystem>;
|
|
28
29
|
getPeople(): ReadonlyArray<Person>;
|
|
29
30
|
}
|
|
30
31
|
export interface ModelDefinitions {
|
|
31
|
-
defineSoftwareSystem(name: string,
|
|
32
|
-
definePerson(name: string,
|
|
32
|
+
defineSoftwareSystem(name: string, archetypeOrDef?: ElementArchetype | SoftwareSystemDefinition, override?: SoftwareSystemDefinition): SoftwareSystem;
|
|
33
|
+
definePerson(name: string, archetypeOrDef?: ElementArchetype | PersonDefinition, override?: PersonDefinition): Person;
|
|
33
34
|
}
|
|
34
35
|
export declare class Model {
|
|
35
36
|
name: string;
|
|
@@ -37,9 +38,9 @@ export declare class Model {
|
|
|
37
38
|
private softwareSystems;
|
|
38
39
|
private people;
|
|
39
40
|
private groups;
|
|
40
|
-
defineSoftwareSystem(name: string,
|
|
41
|
+
defineSoftwareSystem(name: string, archetypeOrDef?: ElementArchetype | SoftwareSystemDefinition, override?: SoftwareSystemDefinition): SoftwareSystem;
|
|
41
42
|
addGroup(groupName: string): Group & ModelDefinitions;
|
|
42
|
-
definePerson(name: string,
|
|
43
|
+
definePerson(name: string, archetypeOrDef?: ElementArchetype | PersonDefinition, override?: PersonDefinition): Person;
|
|
43
44
|
validate(): void;
|
|
44
45
|
getPeople(): ReadonlyArray<Person>;
|
|
45
46
|
getSoftwareSystems(): ReadonlyArray<SoftwareSystem>;
|
|
@@ -47,14 +48,4 @@ export declare class Model {
|
|
|
47
48
|
getSoftwareSystemsNotInGroups(): ReadonlyArray<SoftwareSystem>;
|
|
48
49
|
getGroups(): ReadonlyArray<ModelGroup>;
|
|
49
50
|
}
|
|
50
|
-
export interface BuildModelOptions {
|
|
51
|
-
modelName?: string;
|
|
52
|
-
globPath?: string;
|
|
53
|
-
searchRoot?: string;
|
|
54
|
-
}
|
|
55
|
-
export declare function buildModelWithCatalog<TRoot>(options?: BuildModelOptions): Promise<{
|
|
56
|
-
model: Model;
|
|
57
|
-
catalog: TRoot;
|
|
58
|
-
}>;
|
|
59
|
-
export declare function buildModel(options?: BuildModelOptions): Promise<Model>;
|
|
60
51
|
export {};
|
package/src/person.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Definition, Element } from './core';
|
|
1
|
+
import { Definition, Element, TechnologyDefinition } from './core';
|
|
2
|
+
import { ElementArchetype } from './archetype';
|
|
2
3
|
export type PersonDefinition = Definition;
|
|
3
4
|
export declare class Person extends Element {
|
|
4
5
|
readonly name: string;
|
|
5
|
-
constructor(name: string, definition?: PersonDefinition);
|
|
6
|
+
constructor(name: string, definition?: PersonDefinition, archetype?: ElementArchetype, overrideDefinition?: TechnologyDefinition);
|
|
6
7
|
getChildElements(): ReadonlyArray<Element>;
|
|
7
8
|
}
|
package/src/softwareSystem.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Definition, Element, Group } from './core';
|
|
1
|
+
import { Definition, Element, Group, TechnologyDefinition } from './core';
|
|
2
2
|
import { Container, ContainerDefinition } from './container';
|
|
3
|
+
import { ElementArchetype } from './archetype';
|
|
3
4
|
export type SoftwareSystemDefinition = Definition;
|
|
4
5
|
interface DefineContainer {
|
|
5
|
-
defineContainer(name: string,
|
|
6
|
+
defineContainer(name: string, archetypeOrDef?: ElementArchetype | ContainerDefinition, override?: ContainerDefinition): Container;
|
|
6
7
|
}
|
|
7
8
|
export interface SoftwareSystemReference {
|
|
8
9
|
name: string;
|
|
@@ -12,15 +13,15 @@ export declare class SoftwareSystemGroup extends Group implements DefineContaine
|
|
|
12
13
|
private readonly softwareSystem;
|
|
13
14
|
private _containers;
|
|
14
15
|
constructor(name: string, softwareSystem: DefineContainer);
|
|
15
|
-
defineContainer(name: string,
|
|
16
|
+
defineContainer(name: string, archetypeOrDef?: ElementArchetype | ContainerDefinition, override?: ContainerDefinition): Container;
|
|
16
17
|
getContainers(): ReadonlyArray<Container>;
|
|
17
18
|
}
|
|
18
19
|
export declare class SoftwareSystem extends Element implements DefineContainer {
|
|
19
20
|
readonly name: string;
|
|
20
21
|
private _containers;
|
|
21
22
|
private _groups;
|
|
22
|
-
constructor(name: string, definition?: SoftwareSystemDefinition);
|
|
23
|
-
defineContainer(name: string,
|
|
23
|
+
constructor(name: string, definition?: SoftwareSystemDefinition, archetype?: ElementArchetype, overrideDefinition?: TechnologyDefinition);
|
|
24
|
+
defineContainer(name: string, archetypeOrDef?: ElementArchetype | ContainerDefinition, override?: ContainerDefinition): Container;
|
|
24
25
|
addGroup(groupName: string): SoftwareSystemGroup;
|
|
25
26
|
getGroups(): ReadonlyArray<SoftwareSystemGroup>;
|
|
26
27
|
getChildElements(): ReadonlyArray<Element>;
|
|
@@ -4,12 +4,15 @@ export declare class StructurizrDSLWriter {
|
|
|
4
4
|
private readonly model;
|
|
5
5
|
private readonly views;
|
|
6
6
|
constructor(model: Model, views: Views);
|
|
7
|
+
private collectArchetypes;
|
|
8
|
+
private writeArchetypes;
|
|
7
9
|
private writeElement;
|
|
8
10
|
private writeComponent;
|
|
9
11
|
private writeContainerGroup;
|
|
10
12
|
private writeContainer;
|
|
11
13
|
private writeSoftwareSystemGroup;
|
|
12
14
|
private writeSoftwareSystem;
|
|
15
|
+
private writeRelationship;
|
|
13
16
|
private writeRelationships;
|
|
14
17
|
private writeModelGroup;
|
|
15
18
|
private writeModel;
|