@agilewallaby/c4-model 2.7.0 → 2.8.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/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 +340 -43
- package/src/index.d.ts +138 -45
- package/src/index.js +336 -41
- 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/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[]>;
|