@agilewallaby/c4-model 2.7.0 → 3.0.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 +1 -1
- package/src/archetype.d.ts +9 -1
- package/src/buildModel.d.ts +7 -4
- package/src/container.d.ts +8 -1
- package/src/exportWorkspaceJson.d.ts +4 -0
- package/src/generateDiagrams.d.ts +1 -3
- package/src/index.cjs +408 -97
- package/src/index.d.ts +147 -46
- package/src/index.js +403 -95
- package/src/model.d.ts +13 -3
- package/src/softwareSystem.d.ts +8 -1
- package/src/structurizrDslWriter.d.ts +5 -0
- package/src/validateModel.d.ts +3 -0
- package/src/views.d.ts +63 -2
package/package.json
CHANGED
package/src/archetype.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { TechnologyDefinition } from './core';
|
|
2
|
-
export
|
|
2
|
+
export declare const ELEMENT_KINDS: {
|
|
3
|
+
readonly person: "person";
|
|
4
|
+
readonly softwareSystem: "softwareSystem";
|
|
5
|
+
readonly container: "container";
|
|
6
|
+
readonly component: "component";
|
|
7
|
+
};
|
|
8
|
+
export type ElementKind = (typeof ELEMENT_KINDS)[keyof typeof ELEMENT_KINDS];
|
|
3
9
|
export declare class ElementArchetype {
|
|
4
10
|
readonly name: string;
|
|
5
11
|
readonly elementKind: ElementKind;
|
|
@@ -10,6 +16,7 @@ export declare class ElementArchetype {
|
|
|
10
16
|
readonly description?: string;
|
|
11
17
|
readonly technology?: string;
|
|
12
18
|
readonly tags: ReadonlyArray<string>;
|
|
19
|
+
get canonicalName(): string;
|
|
13
20
|
constructor(name: string, elementKind: ElementKind, definition?: TechnologyDefinition, parent?: ElementArchetype | undefined);
|
|
14
21
|
}
|
|
15
22
|
export declare class RelationshipArchetype {
|
|
@@ -21,6 +28,7 @@ export declare class RelationshipArchetype {
|
|
|
21
28
|
readonly description?: string;
|
|
22
29
|
readonly technology?: string;
|
|
23
30
|
readonly tags: ReadonlyArray<string>;
|
|
31
|
+
get canonicalName(): string;
|
|
24
32
|
constructor(name: string, definition?: TechnologyDefinition, parent?: RelationshipArchetype | undefined);
|
|
25
33
|
}
|
|
26
34
|
export declare function mergeArchetypeWithOverride(archetype: {
|
package/src/buildModel.d.ts
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
import { Model } from './model';
|
|
2
2
|
import { ElementArchetype, RelationshipArchetype } from './archetype';
|
|
3
|
+
import { Views } from './views';
|
|
3
4
|
type Catalog = Record<string, unknown>;
|
|
4
5
|
type RootCatalog = Record<string, Catalog>;
|
|
5
6
|
export interface AnyC4Module {
|
|
6
7
|
readonly key: string;
|
|
7
8
|
registerDefinitions(model: Model, archetypes: Record<string, ElementArchetype | RelationshipArchetype>): Catalog;
|
|
8
|
-
|
|
9
|
+
addRelationships(local: Catalog, dependencies: RootCatalog, archetypes: Record<string, ElementArchetype | RelationshipArchetype>): void;
|
|
10
|
+
addViews?(views: Views, local: Catalog, dependencies: RootCatalog): void;
|
|
9
11
|
}
|
|
10
|
-
export interface BuildModelOptions {
|
|
12
|
+
export interface BuildModelOptions<TRoot = Record<string, unknown>> {
|
|
11
13
|
modelName?: string;
|
|
12
14
|
modules?: ReadonlyArray<AnyC4Module>;
|
|
13
15
|
globPath?: string;
|
|
14
16
|
searchRoot?: string;
|
|
15
17
|
archetypes?: Record<string, ElementArchetype | RelationshipArchetype>;
|
|
18
|
+
addViews?: (views: Views, catalog: TRoot) => void;
|
|
16
19
|
}
|
|
17
|
-
export declare function
|
|
20
|
+
export declare function buildModel<TRoot>(options?: BuildModelOptions<TRoot>): Promise<{
|
|
18
21
|
model: Model;
|
|
19
22
|
catalog: TRoot;
|
|
23
|
+
views: Views;
|
|
20
24
|
}>;
|
|
21
|
-
export declare function buildModel(options?: BuildModelOptions): Promise<Model>;
|
|
22
25
|
export {};
|
package/src/container.d.ts
CHANGED
|
@@ -8,10 +8,17 @@ interface DefineComponent {
|
|
|
8
8
|
export declare class ContainerGroup extends Group<Component> implements DefineComponent {
|
|
9
9
|
readonly name: string;
|
|
10
10
|
private readonly container;
|
|
11
|
+
private readonly pathSegments;
|
|
11
12
|
private _components;
|
|
12
|
-
|
|
13
|
+
private _groups;
|
|
14
|
+
constructor(name: string, container: DefineComponent, pathSegments?: string[]);
|
|
15
|
+
get canonicalName(): string;
|
|
16
|
+
get dslName(): string;
|
|
13
17
|
component(name: string, archetypeOrDef?: ElementArchetype | ComponentDefinition, override?: ComponentDefinition): Component;
|
|
18
|
+
group(groupName: string): ContainerGroup;
|
|
19
|
+
getGroups(): ReadonlyArray<ContainerGroup>;
|
|
14
20
|
getComponents(): ReadonlyArray<Component>;
|
|
21
|
+
getAllComponents(): ReadonlyArray<Component>;
|
|
15
22
|
}
|
|
16
23
|
export declare class Container extends TechnicalElement<Component> implements DefineComponent {
|
|
17
24
|
readonly name: string;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { BuildModelOptions } from './buildModel';
|
|
2
|
-
|
|
3
|
-
export interface GenerateDiagramsOptions<TRoot> extends BuildModelOptions {
|
|
4
|
-
views: (catalog: TRoot) => Views;
|
|
2
|
+
export interface GenerateDiagramsOptions<TRoot> extends BuildModelOptions<TRoot> {
|
|
5
3
|
outputDir: string;
|
|
6
4
|
}
|
|
7
5
|
export declare function generateDiagrams<TRoot>(options: GenerateDiagramsOptions<TRoot>): Promise<string[]>;
|