wabachi 0.1.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/LICENSE +21 -0
- package/README.md +84 -0
- package/dist/architecture/canon/authority.d.ts +35 -0
- package/dist/architecture/canon/authority.js +76 -0
- package/dist/architecture/canon/authority.js.map +1 -0
- package/dist/architecture/canon/boundaries.d.ts +31 -0
- package/dist/architecture/canon/boundaries.js +73 -0
- package/dist/architecture/canon/boundaries.js.map +1 -0
- package/dist/architecture/canon/codec.d.ts +10 -0
- package/dist/architecture/canon/codec.js +516 -0
- package/dist/architecture/canon/codec.js.map +1 -0
- package/dist/architecture/canon/constraints.d.ts +60 -0
- package/dist/architecture/canon/constraints.js +116 -0
- package/dist/architecture/canon/constraints.js.map +1 -0
- package/dist/architecture/canon/decisions.d.ts +62 -0
- package/dist/architecture/canon/decisions.js +192 -0
- package/dist/architecture/canon/decisions.js.map +1 -0
- package/dist/architecture/canon/deployment.d.ts +89 -0
- package/dist/architecture/canon/deployment.js +156 -0
- package/dist/architecture/canon/deployment.js.map +1 -0
- package/dist/architecture/canon/document.d.ts +60 -0
- package/dist/architecture/canon/document.js +106 -0
- package/dist/architecture/canon/document.js.map +1 -0
- package/dist/architecture/canon/elements.d.ts +21 -0
- package/dist/architecture/canon/elements.js +87 -0
- package/dist/architecture/canon/elements.js.map +1 -0
- package/dist/architecture/canon/flows.d.ts +37 -0
- package/dist/architecture/canon/flows.js +82 -0
- package/dist/architecture/canon/flows.js.map +1 -0
- package/dist/architecture/canon/identity.d.ts +45 -0
- package/dist/architecture/canon/identity.js +83 -0
- package/dist/architecture/canon/identity.js.map +1 -0
- package/dist/architecture/canon/relationships.d.ts +48 -0
- package/dist/architecture/canon/relationships.js +181 -0
- package/dist/architecture/canon/relationships.js.map +1 -0
- package/dist/architecture/canon/repository-mappings.d.ts +51 -0
- package/dist/architecture/canon/repository-mappings.js +134 -0
- package/dist/architecture/canon/repository-mappings.js.map +1 -0
- package/dist/architecture/canon/responsibilities.d.ts +40 -0
- package/dist/architecture/canon/responsibilities.js +89 -0
- package/dist/architecture/canon/responsibilities.js.map +1 -0
- package/dist/architecture/canon/validate.d.ts +14 -0
- package/dist/architecture/canon/validate.js +389 -0
- package/dist/architecture/canon/validate.js.map +1 -0
- package/dist/architecture/canon/views.d.ts +101 -0
- package/dist/architecture/canon/views.js +182 -0
- package/dist/architecture/canon/views.js.map +1 -0
- package/dist/architecture/cli.d.ts +2 -0
- package/dist/architecture/cli.js +158 -0
- package/dist/architecture/cli.js.map +1 -0
- package/dist/architecture/documentation/html.d.ts +3 -0
- package/dist/architecture/documentation/html.js +143 -0
- package/dist/architecture/documentation/html.js.map +1 -0
- package/dist/architecture/documentation/model.d.ts +46 -0
- package/dist/architecture/documentation/model.js +13 -0
- package/dist/architecture/documentation/model.js.map +1 -0
- package/dist/architecture/documentation/project.d.ts +4 -0
- package/dist/architecture/documentation/project.js +166 -0
- package/dist/architecture/documentation/project.js.map +1 -0
- package/dist/architecture/documentation/site.d.ts +43 -0
- package/dist/architecture/documentation/site.js +147 -0
- package/dist/architecture/documentation/site.js.map +1 -0
- package/dist/architecture/projection/structurizr-export.d.ts +65 -0
- package/dist/architecture/projection/structurizr-export.js +136 -0
- package/dist/architecture/projection/structurizr-export.js.map +1 -0
- package/dist/architecture/projection/structurizr.d.ts +34 -0
- package/dist/architecture/projection/structurizr.js +667 -0
- package/dist/architecture/projection/structurizr.js.map +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +143 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/runtime/correlation.d.ts +143 -0
- package/dist/runtime/correlation.js +919 -0
- package/dist/runtime/correlation.js.map +1 -0
- package/dist/runtime/facts.d.ts +138 -0
- package/dist/runtime/facts.js +614 -0
- package/dist/runtime/facts.js.map +1 -0
- package/dist/runtime/fixtureProvider.d.ts +10 -0
- package/dist/runtime/fixtureProvider.js +30 -0
- package/dist/runtime/fixtureProvider.js.map +1 -0
- package/dist/runtime/graftProvider.d.ts +8 -0
- package/dist/runtime/graftProvider.js +107 -0
- package/dist/runtime/graftProvider.js.map +1 -0
- package/dist/runtime/graftWiring.d.ts +30 -0
- package/dist/runtime/graftWiring.js +3 -0
- package/dist/runtime/graftWiring.js.map +1 -0
- package/dist/runtime/manifest.d.ts +17 -0
- package/dist/runtime/manifest.js +39 -0
- package/dist/runtime/manifest.js.map +1 -0
- package/dist/runtime/matrix.d.ts +337 -0
- package/dist/runtime/matrix.js +1485 -0
- package/dist/runtime/matrix.js.map +1 -0
- package/dist/runtime/observation.d.ts +36 -0
- package/dist/runtime/observation.js +3 -0
- package/dist/runtime/observation.js.map +1 -0
- package/dist/runtime/provider.d.ts +34 -0
- package/dist/runtime/provider.js +2 -0
- package/dist/runtime/provider.js.map +1 -0
- package/dist/runtime/repository.d.ts +20 -0
- package/dist/runtime/repository.js +55 -0
- package/dist/runtime/repository.js.map +1 -0
- package/dist/runtime/run.d.ts +21 -0
- package/dist/runtime/run.js +80 -0
- package/dist/runtime/run.js.map +1 -0
- package/dist/runtime/scipProvider.d.ts +11 -0
- package/dist/runtime/scipProvider.js +126 -0
- package/dist/runtime/scipProvider.js.map +1 -0
- package/dist/runtime/typescriptProvider.d.ts +10 -0
- package/dist/runtime/typescriptProvider.js +289 -0
- package/dist/runtime/typescriptProvider.js.map +1 -0
- package/dist/runtime/workflow.d.ts +30 -0
- package/dist/runtime/workflow.js +153 -0
- package/dist/runtime/workflow.js.map +1 -0
- package/package.json +72 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type ArchitectureIdentity, type CanonVersion, type DocumentId, type IdentityInput } from "./identity.js";
|
|
2
|
+
import { type ElementInput, type ElementRecord } from "./elements.js";
|
|
3
|
+
import { type InterfaceInput, type InterfaceRecord, type RelationshipInput, type RelationshipRecord } from "./relationships.js";
|
|
4
|
+
import { type ResponsibilitySet, type ResponsibilitySetInput } from "./responsibilities.js";
|
|
5
|
+
import { type AuthorityOwnershipFacts, type AuthorityOwnershipFactsInput } from "./authority.js";
|
|
6
|
+
import { type Boundary, type BoundaryInput } from "./boundaries.js";
|
|
7
|
+
import { type ArchitectureConstraint, type ArchitectureConstraintInput } from "./constraints.js";
|
|
8
|
+
import { type Flow, type FlowInput } from "./flows.js";
|
|
9
|
+
import { type DeploymentTopology, type DeploymentTopologyInput } from "./deployment.js";
|
|
10
|
+
import { type RepositoryMapping, type RepositoryMappingInput } from "./repository-mappings.js";
|
|
11
|
+
import { type ArchitectureDecisions, type ArchitectureDecisionsInput } from "./decisions.js";
|
|
12
|
+
import { type ViewInput, type ViewSpec } from "./views.js";
|
|
13
|
+
/** Canon v1 sections are emitted in the order established by leaf implementation order. */
|
|
14
|
+
export declare const CANON_SECTION_ORDER: readonly ["elements", "interfaces", "relationships", "responsibilities", "authority", "boundaries", "constraints", "flows", "deployment", "repositoryMappings", "decisions", "views"];
|
|
15
|
+
export type CanonSectionName = (typeof CANON_SECTION_ORDER)[number];
|
|
16
|
+
export interface ArchitectureDocumentInput {
|
|
17
|
+
readonly documentId: string;
|
|
18
|
+
readonly root: IdentityInput;
|
|
19
|
+
readonly elements?: readonly ElementInput[];
|
|
20
|
+
readonly interfaces?: readonly InterfaceInput[];
|
|
21
|
+
readonly relationships?: readonly RelationshipInput[];
|
|
22
|
+
readonly responsibilities?: ResponsibilitySetInput;
|
|
23
|
+
readonly authority?: AuthorityOwnershipFactsInput;
|
|
24
|
+
readonly boundaries?: readonly BoundaryInput[];
|
|
25
|
+
readonly constraints?: readonly ArchitectureConstraintInput[];
|
|
26
|
+
readonly flows?: readonly FlowInput[];
|
|
27
|
+
readonly deployment?: DeploymentTopologyInput;
|
|
28
|
+
readonly repositoryMappings?: readonly RepositoryMappingInput[];
|
|
29
|
+
readonly decisions?: ArchitectureDecisionsInput;
|
|
30
|
+
readonly views?: readonly ViewInput[];
|
|
31
|
+
}
|
|
32
|
+
export type GlobalIdentityNamespace = "architecture" | "element" | "interface" | "responsibility" | "boundary" | "flow" | "decision" | "reference";
|
|
33
|
+
export interface GlobalIdentityEntry {
|
|
34
|
+
readonly id: string;
|
|
35
|
+
readonly namespace: GlobalIdentityNamespace;
|
|
36
|
+
}
|
|
37
|
+
/** Deterministic registry of canonical identities owned by the complete document. */
|
|
38
|
+
export interface GlobalIdentityRegistry {
|
|
39
|
+
readonly entries: readonly GlobalIdentityEntry[];
|
|
40
|
+
}
|
|
41
|
+
export interface ArchitectureDocumentV1 {
|
|
42
|
+
readonly canonVersion: CanonVersion;
|
|
43
|
+
readonly documentId: DocumentId;
|
|
44
|
+
readonly root: ArchitectureIdentity;
|
|
45
|
+
readonly elements: readonly ElementRecord[];
|
|
46
|
+
readonly interfaces: readonly InterfaceRecord[];
|
|
47
|
+
readonly relationships: readonly RelationshipRecord[];
|
|
48
|
+
readonly responsibilities: ResponsibilitySet;
|
|
49
|
+
readonly authority: AuthorityOwnershipFacts;
|
|
50
|
+
readonly boundaries: readonly Boundary[];
|
|
51
|
+
readonly constraints: readonly ArchitectureConstraint[];
|
|
52
|
+
readonly flows: readonly Flow[];
|
|
53
|
+
readonly deployment: DeploymentTopology;
|
|
54
|
+
readonly repositoryMappings: readonly RepositoryMapping[];
|
|
55
|
+
readonly decisions: ArchitectureDecisions;
|
|
56
|
+
readonly views: readonly ViewSpec[];
|
|
57
|
+
readonly globalIdentityRegistry: GlobalIdentityRegistry;
|
|
58
|
+
}
|
|
59
|
+
/** Compose all Canon v1 leaf sections without performing cross-section validation. */
|
|
60
|
+
export declare function createArchitectureDocument(input: ArchitectureDocumentInput): ArchitectureDocumentV1;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { CANON_VERSION, createArchitectureIdentity, createDocumentId, } from "./identity.js";
|
|
2
|
+
import { normalizeElements } from "./elements.js";
|
|
3
|
+
import { normalizeInterfaces, normalizeRelationships, } from "./relationships.js";
|
|
4
|
+
import { createResponsibilitySet } from "./responsibilities.js";
|
|
5
|
+
import { createAuthorityOwnershipFacts, } from "./authority.js";
|
|
6
|
+
import { createBoundaries } from "./boundaries.js";
|
|
7
|
+
import { createConstraints } from "./constraints.js";
|
|
8
|
+
import { createFlows } from "./flows.js";
|
|
9
|
+
import { createDeploymentTopology } from "./deployment.js";
|
|
10
|
+
import { createRepositoryMappings, } from "./repository-mappings.js";
|
|
11
|
+
import { createArchitectureDecisions, } from "./decisions.js";
|
|
12
|
+
import { normalizeViews } from "./views.js";
|
|
13
|
+
/** Canon v1 sections are emitted in the order established by leaf implementation order. */
|
|
14
|
+
export const CANON_SECTION_ORDER = [
|
|
15
|
+
"elements",
|
|
16
|
+
"interfaces",
|
|
17
|
+
"relationships",
|
|
18
|
+
"responsibilities",
|
|
19
|
+
"authority",
|
|
20
|
+
"boundaries",
|
|
21
|
+
"constraints",
|
|
22
|
+
"flows",
|
|
23
|
+
"deployment",
|
|
24
|
+
"repositoryMappings",
|
|
25
|
+
"decisions",
|
|
26
|
+
"views",
|
|
27
|
+
];
|
|
28
|
+
function assertDocumentInput(input) {
|
|
29
|
+
if (input === null || typeof input !== "object" || Array.isArray(input)) {
|
|
30
|
+
throw new TypeError("architecture document must be an object");
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function compareIdentityEntries(left, right) {
|
|
34
|
+
if (left.id < right.id)
|
|
35
|
+
return -1;
|
|
36
|
+
if (left.id > right.id)
|
|
37
|
+
return 1;
|
|
38
|
+
if (left.namespace < right.namespace)
|
|
39
|
+
return -1;
|
|
40
|
+
if (left.namespace > right.namespace)
|
|
41
|
+
return 1;
|
|
42
|
+
return 0;
|
|
43
|
+
}
|
|
44
|
+
function createGlobalIdentityRegistry(document) {
|
|
45
|
+
const entries = [
|
|
46
|
+
{ id: document.root.id, namespace: "architecture" },
|
|
47
|
+
...document.elements.map(({ id }) => ({ id, namespace: "element" })),
|
|
48
|
+
...document.interfaces.map(({ id }) => ({ id, namespace: "interface" })),
|
|
49
|
+
...document.responsibilities.responsibilities.map(({ id }) => ({ id, namespace: "responsibility" })),
|
|
50
|
+
...document.boundaries.map(({ id }) => ({ id, namespace: "boundary" })),
|
|
51
|
+
...document.flows.map(({ id }) => ({ id, namespace: "flow" })),
|
|
52
|
+
...document.decisions.decisions.map(({ id }) => ({ id, namespace: "decision" })),
|
|
53
|
+
...document.decisions.references.map(({ id }) => ({ id, namespace: "reference" })),
|
|
54
|
+
];
|
|
55
|
+
entries.sort(compareIdentityEntries);
|
|
56
|
+
for (let index = 1; index < entries.length; index += 1) {
|
|
57
|
+
const previous = entries[index - 1];
|
|
58
|
+
const current = entries[index];
|
|
59
|
+
if (previous.id === current.id) {
|
|
60
|
+
throw new Error(`duplicate canonical id: ${current.id} (${previous.namespace}, ${current.namespace})`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return Object.freeze({
|
|
64
|
+
entries: Object.freeze(entries.map((entry) => Object.freeze(entry))),
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/** Compose all Canon v1 leaf sections without performing cross-section validation. */
|
|
68
|
+
export function createArchitectureDocument(input) {
|
|
69
|
+
assertDocumentInput(input);
|
|
70
|
+
const root = createArchitectureIdentity(input.root);
|
|
71
|
+
const documentId = createDocumentId(input.documentId);
|
|
72
|
+
const elements = normalizeElements(input.elements ?? []);
|
|
73
|
+
const interfaces = normalizeInterfaces(input.interfaces ?? []);
|
|
74
|
+
const relationships = normalizeRelationships(input.relationships ?? []);
|
|
75
|
+
const responsibilities = createResponsibilitySet(input.responsibilities ?? {});
|
|
76
|
+
const authority = createAuthorityOwnershipFacts(input.authority ?? {});
|
|
77
|
+
const boundaries = createBoundaries(input.boundaries ?? []);
|
|
78
|
+
const constraints = createConstraints(input.constraints ?? []);
|
|
79
|
+
const flows = createFlows(input.flows ?? []);
|
|
80
|
+
const deployment = createDeploymentTopology(input.deployment ?? {});
|
|
81
|
+
const repositoryMappings = createRepositoryMappings(input.repositoryMappings ?? []);
|
|
82
|
+
const decisions = createArchitectureDecisions(input.decisions ?? {});
|
|
83
|
+
const views = normalizeViews(input.views ?? []);
|
|
84
|
+
const document = {
|
|
85
|
+
canonVersion: CANON_VERSION,
|
|
86
|
+
documentId,
|
|
87
|
+
root,
|
|
88
|
+
elements,
|
|
89
|
+
interfaces,
|
|
90
|
+
relationships,
|
|
91
|
+
responsibilities,
|
|
92
|
+
authority,
|
|
93
|
+
boundaries,
|
|
94
|
+
constraints,
|
|
95
|
+
flows,
|
|
96
|
+
deployment,
|
|
97
|
+
repositoryMappings,
|
|
98
|
+
decisions,
|
|
99
|
+
views,
|
|
100
|
+
};
|
|
101
|
+
return Object.freeze({
|
|
102
|
+
...document,
|
|
103
|
+
globalIdentityRegistry: createGlobalIdentityRegistry(document),
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document.js","sourceRoot":"","sources":["../../../src/architecture/canon/document.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,0BAA0B,EAC1B,gBAAgB,GAKjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAyC,MAAM,eAAe,CAAC;AACzF,OAAO,EACL,mBAAmB,EACnB,sBAAsB,GAKvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,uBAAuB,EAAuD,MAAM,uBAAuB,CAAC;AACrH,OAAO,EACL,6BAA6B,GAG9B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAqC,MAAM,iBAAiB,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAiE,MAAM,kBAAkB,CAAC;AACpH,OAAO,EAAE,WAAW,EAA6B,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAyD,MAAM,iBAAiB,CAAC;AAClH,OAAO,EACL,wBAAwB,GAGzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,2BAA2B,GAG5B,MAAM,gBAAg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AG,WAAW,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IAC7C,MAAM,UAAU,GAAG,wBAAwB,CAAC,KAAK,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC;IACpE,MAAM,kBAAkB,GAAG,wBAAwB,CAAC,KAAK,CAAC,kBAAkB,IAAI,EAAE,CAAC,CAAC;IACpF,MAAM,SAAS,GAAG,2BAA2B,CAAC,KAAK,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;IACrE,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IAEhD,MAAM,QAAQ,GAAG;QACf,YAAY,EAAE,aAAa;QAC3B,UAAU;QACV,IAAI;QACJ,QAAQ;QACR,UAAU;QACV,aAAa;QACb,gBAAgB;QAChB,SAAS;QACT,UAAU;QACV,WAAW;QACX,KAAK;QACL,UAAU;QACV,kBAAkB;QAClB,SAAS;QACT,KAAK;KAC2D,CAAC;IAEnE,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,GAAG,QAAQ;QACX,sBAAsB,EAAE,4BAA4B,CAAC,QAAQ,CAAC;KAC/D,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ObjectId } from "./identity.js";
|
|
2
|
+
/** The canonical kinds supported by an Architecture Canon element record. */
|
|
3
|
+
export declare const ELEMENT_KINDS: readonly ["system", "service", "component", "data-store", "external-system"];
|
|
4
|
+
export type ElementKind = (typeof ELEMENT_KINDS)[number];
|
|
5
|
+
export interface ElementInput {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly kind: ElementKind;
|
|
8
|
+
readonly displayName?: string;
|
|
9
|
+
readonly parentId?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ElementRecord {
|
|
12
|
+
readonly id: ObjectId;
|
|
13
|
+
readonly kind: ElementKind;
|
|
14
|
+
readonly parentId?: ObjectId;
|
|
15
|
+
}
|
|
16
|
+
/** Create one canonical record; display names are deliberately not semantic identity. */
|
|
17
|
+
export declare function createElement(input: ElementInput): ElementRecord;
|
|
18
|
+
/** Normalize records into a frozen, deterministic, validated containment set. */
|
|
19
|
+
export declare function normalizeElements(inputs: readonly ElementInput[]): readonly ElementRecord[];
|
|
20
|
+
/** Validate an already-created record set without changing its order. */
|
|
21
|
+
export declare function validateContainment(elements: readonly ElementRecord[]): void;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { createObjectId, normalizeIdentityId } from "./identity.js";
|
|
2
|
+
/** The canonical kinds supported by an Architecture Canon element record. */
|
|
3
|
+
export const ELEMENT_KINDS = ["system", "service", "component", "data-store", "external-system"];
|
|
4
|
+
function assertRecordInput(input) {
|
|
5
|
+
if (input === null || typeof input !== "object" || Array.isArray(input)) {
|
|
6
|
+
throw new TypeError("element must be an object");
|
|
7
|
+
}
|
|
8
|
+
const candidate = input;
|
|
9
|
+
normalizeIdentityId(candidate.id);
|
|
10
|
+
if (!ELEMENT_KINDS.includes(candidate.kind)) {
|
|
11
|
+
throw new TypeError(`element kind is unsupported: ${String(candidate.kind)}`);
|
|
12
|
+
}
|
|
13
|
+
if (candidate.displayName !== undefined && typeof candidate.displayName !== "string") {
|
|
14
|
+
throw new TypeError("element displayName must be a string");
|
|
15
|
+
}
|
|
16
|
+
if (candidate.parentId !== undefined) {
|
|
17
|
+
normalizeIdentityId(candidate.parentId);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/** Create one canonical record; display names are deliberately not semantic identity. */
|
|
21
|
+
export function createElement(input) {
|
|
22
|
+
assertRecordInput(input);
|
|
23
|
+
const record = {
|
|
24
|
+
id: createObjectId(input.id),
|
|
25
|
+
kind: input.kind,
|
|
26
|
+
};
|
|
27
|
+
if (input.parentId !== undefined) {
|
|
28
|
+
return Object.freeze({ ...record, parentId: createObjectId(input.parentId) });
|
|
29
|
+
}
|
|
30
|
+
return Object.freeze(record);
|
|
31
|
+
}
|
|
32
|
+
function compareElements(left, right) {
|
|
33
|
+
if (left.id < right.id)
|
|
34
|
+
return -1;
|
|
35
|
+
if (left.id > right.id)
|
|
36
|
+
return 1;
|
|
37
|
+
return 0;
|
|
38
|
+
}
|
|
39
|
+
function assertContainmentIsValid(elements) {
|
|
40
|
+
const byId = new Map();
|
|
41
|
+
for (const element of elements) {
|
|
42
|
+
if (byId.has(element.id)) {
|
|
43
|
+
throw new Error(`duplicate element id: ${element.id}`);
|
|
44
|
+
}
|
|
45
|
+
byId.set(element.id, element);
|
|
46
|
+
}
|
|
47
|
+
for (const element of elements) {
|
|
48
|
+
if (element.parentId !== undefined && !byId.has(element.parentId)) {
|
|
49
|
+
throw new Error(`unknown parent id: ${element.parentId}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const visiting = new Set();
|
|
53
|
+
const visited = new Set();
|
|
54
|
+
const visit = (element) => {
|
|
55
|
+
if (visited.has(element.id))
|
|
56
|
+
return;
|
|
57
|
+
if (visiting.has(element.id)) {
|
|
58
|
+
throw new Error(`containment cycle detected at: ${element.id}`);
|
|
59
|
+
}
|
|
60
|
+
visiting.add(element.id);
|
|
61
|
+
if (element.parentId !== undefined) {
|
|
62
|
+
visit(byId.get(element.parentId));
|
|
63
|
+
}
|
|
64
|
+
visiting.delete(element.id);
|
|
65
|
+
visited.add(element.id);
|
|
66
|
+
};
|
|
67
|
+
for (const element of elements)
|
|
68
|
+
visit(element);
|
|
69
|
+
}
|
|
70
|
+
/** Normalize records into a frozen, deterministic, validated containment set. */
|
|
71
|
+
export function normalizeElements(inputs) {
|
|
72
|
+
if (!Array.isArray(inputs)) {
|
|
73
|
+
throw new TypeError("elements must be an array");
|
|
74
|
+
}
|
|
75
|
+
const elements = inputs.map(createElement);
|
|
76
|
+
assertContainmentIsValid(elements);
|
|
77
|
+
elements.sort(compareElements);
|
|
78
|
+
return Object.freeze(elements);
|
|
79
|
+
}
|
|
80
|
+
/** Validate an already-created record set without changing its order. */
|
|
81
|
+
export function validateContainment(elements) {
|
|
82
|
+
if (!Array.isArray(elements)) {
|
|
83
|
+
throw new TypeError("elements must be an array");
|
|
84
|
+
}
|
|
85
|
+
assertContainmentIsValid(elements);
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=elements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elements.js","sourceRoot":"","sources":["../../../src/architecture/canon/elements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAiB,MAAM,eAAe,CAAC;AAEnF,6EAA6E;AAC7E,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,iBAAiB,CAAU,CAAC;AAiB1G,SAAS,iBAAiB,CAAC,KAAc;IACvC,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,SAAS,CAAC,2BAA2B,CAAC,CAAC;IACnD,CAAC;IAED,MAAM,SAAS,GAAG,KAKjB,CAAC;IAEF,mBAAmB,CAAC,SAAS,CAAC,EAAY,CAAC,CAAC;IAC5C,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAmB,CAAC,EAAE,CAAC;QAC3D,MAAM,IAAI,SAAS,CAAC,gCAAgC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChF,CAAC;IACD,IAAI,SAAS,CAAC,WAAW,KAAK,SAAS,IAAI,OAAO,SAAS,CAAC,WAAW,KAAK,QAAQ,EAAE,CAAC;QACrF,MAAM,IAAI,SAAS,CAAC,sCAAsC,CAAC,CAAC;IAC9D,CAAC;IACD,IAAI,SAAS,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;QACrC,mBAAmB,CAAC,SAAS,CAAC,QAAkB,CAAC,CAAC;IACpD,CAAC;AACH,CAAC;AAED,y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C;IACnC,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAE/B,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AACjC,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,mBAAmB,CAAC,QAAkC;IACpE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,SAAS,CAAC,2BAA2B,CAAC,CAAC;IACnD,CAAC;IACD,wBAAwB,CAAC,QAAQ,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
declare const flowIdBrand: unique symbol;
|
|
2
|
+
export type FlowId = string & {
|
|
3
|
+
readonly [flowIdBrand]: never;
|
|
4
|
+
};
|
|
5
|
+
export interface FlowStepInput {
|
|
6
|
+
/** An opaque canonical relationship identity resolved by complete-document validation. */
|
|
7
|
+
readonly relationshipId?: string;
|
|
8
|
+
/** An opaque canonical interface identity resolved by complete-document validation. */
|
|
9
|
+
readonly interfaceId?: string;
|
|
10
|
+
readonly operation?: string;
|
|
11
|
+
readonly information?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface FlowStep {
|
|
14
|
+
readonly relationshipId?: string;
|
|
15
|
+
readonly interfaceId?: string;
|
|
16
|
+
readonly operation?: string;
|
|
17
|
+
readonly information?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface FlowInput {
|
|
20
|
+
readonly id: string;
|
|
21
|
+
readonly steps: readonly FlowStepInput[];
|
|
22
|
+
}
|
|
23
|
+
export interface Flow {
|
|
24
|
+
readonly id: FlowId;
|
|
25
|
+
/** Step order is semantic and is intentionally never sorted. */
|
|
26
|
+
readonly steps: readonly FlowStep[];
|
|
27
|
+
}
|
|
28
|
+
export declare function createFlow(input: FlowInput): Flow;
|
|
29
|
+
/**
|
|
30
|
+
* Creates a deterministic flow collection. Flow identity order is canonical;
|
|
31
|
+
* step order remains exactly the declared semantic sequence.
|
|
32
|
+
*
|
|
33
|
+
* Relationship and interface references are intentionally opaque here. Their
|
|
34
|
+
* existence is checked only by complete-document validation.
|
|
35
|
+
*/
|
|
36
|
+
export declare function createFlows(inputs: readonly FlowInput[]): readonly Flow[];
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { normalizeIdentityId } from "./identity.js";
|
|
2
|
+
function assertRecord(value, label) {
|
|
3
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
4
|
+
throw new TypeError(`${label} must be an object`);
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
function normalizeId(value, label) {
|
|
8
|
+
if (typeof value !== "string") {
|
|
9
|
+
throw new TypeError(`${label} must be a string`);
|
|
10
|
+
}
|
|
11
|
+
try {
|
|
12
|
+
return normalizeIdentityId(value);
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
throw new TypeError(`${label} is malformed`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function normalizeText(value, label) {
|
|
19
|
+
if (typeof value !== "string") {
|
|
20
|
+
throw new TypeError(`${label} must be a string`);
|
|
21
|
+
}
|
|
22
|
+
const normalized = value.normalize("NFC");
|
|
23
|
+
if (normalized.trim().length === 0 || /[\p{Cc}\p{Cf}\p{Cs}]/u.test(normalized)) {
|
|
24
|
+
throw new TypeError(`${label} is malformed`);
|
|
25
|
+
}
|
|
26
|
+
return normalized;
|
|
27
|
+
}
|
|
28
|
+
function compareOrdinal(left, right) {
|
|
29
|
+
if (left < right)
|
|
30
|
+
return -1;
|
|
31
|
+
if (left > right)
|
|
32
|
+
return 1;
|
|
33
|
+
return 0;
|
|
34
|
+
}
|
|
35
|
+
function normalizeFlowStep(input) {
|
|
36
|
+
assertRecord(input, "flow step");
|
|
37
|
+
const relationshipId = input.relationshipId === undefined ? undefined : normalizeId(input.relationshipId, "flow step relationshipId");
|
|
38
|
+
const interfaceId = input.interfaceId === undefined ? undefined : normalizeId(input.interfaceId, "flow step interfaceId");
|
|
39
|
+
if (relationshipId === undefined && interfaceId === undefined) {
|
|
40
|
+
throw new TypeError("flow step must reference a relationship or interface");
|
|
41
|
+
}
|
|
42
|
+
const operation = input.operation === undefined ? undefined : normalizeText(input.operation, "flow step operation");
|
|
43
|
+
const information = input.information === undefined ? undefined : normalizeText(input.information, "flow step information");
|
|
44
|
+
return Object.freeze({
|
|
45
|
+
...(relationshipId === undefined ? {} : { relationshipId }),
|
|
46
|
+
...(interfaceId === undefined ? {} : { interfaceId }),
|
|
47
|
+
...(operation === undefined ? {} : { operation }),
|
|
48
|
+
...(information === undefined ? {} : { information }),
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
export function createFlow(input) {
|
|
52
|
+
assertRecord(input, "flow");
|
|
53
|
+
const id = normalizeId(input.id, "flow id");
|
|
54
|
+
if (!Array.isArray(input.steps)) {
|
|
55
|
+
throw new TypeError("flow steps must be an array");
|
|
56
|
+
}
|
|
57
|
+
const steps = input.steps.map(normalizeFlowStep);
|
|
58
|
+
return Object.freeze({ id, steps: Object.freeze(steps) });
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Creates a deterministic flow collection. Flow identity order is canonical;
|
|
62
|
+
* step order remains exactly the declared semantic sequence.
|
|
63
|
+
*
|
|
64
|
+
* Relationship and interface references are intentionally opaque here. Their
|
|
65
|
+
* existence is checked only by complete-document validation.
|
|
66
|
+
*/
|
|
67
|
+
export function createFlows(inputs) {
|
|
68
|
+
if (!Array.isArray(inputs)) {
|
|
69
|
+
throw new TypeError("flows must be an array");
|
|
70
|
+
}
|
|
71
|
+
const flows = inputs.map(createFlow);
|
|
72
|
+
const seen = new Set();
|
|
73
|
+
for (const flow of flows) {
|
|
74
|
+
if (seen.has(flow.id)) {
|
|
75
|
+
throw new Error(`duplicate flow id: ${flow.id}`);
|
|
76
|
+
}
|
|
77
|
+
seen.add(flow.id);
|
|
78
|
+
}
|
|
79
|
+
flows.sort((left, right) => compareOrdinal(left.id, right.id));
|
|
80
|
+
return Object.freeze(flows);
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=flows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flows.js","sourceRoot":"","sources":["../../../src/architecture/canon/flows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAiCpD,SAAS,YAAY,CAAC,KAAc,EAAE,KAAa;IACjD,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,SAAS,CAAC,GAAG,KAAK,oBAAoB,CAAC,CAAC;IACpD,CAAC;AACH,CAAC;AAED,SAAS,WAAW,CAAC,KAAc,EAAE,KAAa;IAChD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,SAAS,CAAC,GAAG,KAAK,mBAAmB,CAAC,CAAC;IACnD,CAAC;IAED,IAAI,CAAC;QACH,OAAO,mBAAmB,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,SAAS,CAAC,GAAG,KAAK,eAAe,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC;AAED,SAAS,aAAa,CAAC,KAAc,EAAE,KAAa;IAClD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,SAAS,CAAC,GAAG,KAAK,mBAAmB,CAAC,CAAC;IACnD,CAAC;IAED,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC1C,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,IAAI,uBAAuB,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/E,MAAM,IAAI,SAAS,CAAC,GAAG,KAAK,eAAe,CAAC,CAAC;IAC/C,CAAC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MAAM,IAAI,KAAK,CAAC,sBAAsB,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QACnD,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/D,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
declare const CANON_VERSION: 1;
|
|
2
|
+
declare const architectureIdBrand: unique symbol;
|
|
3
|
+
declare const objectIdBrand: unique symbol;
|
|
4
|
+
declare const documentIdBrand: unique symbol;
|
|
5
|
+
export type CanonVersion = typeof CANON_VERSION;
|
|
6
|
+
export type ArchitectureId = string & {
|
|
7
|
+
readonly [architectureIdBrand]: never;
|
|
8
|
+
};
|
|
9
|
+
export type ObjectId = string & {
|
|
10
|
+
readonly [objectIdBrand]: never;
|
|
11
|
+
};
|
|
12
|
+
export type DocumentId = string & {
|
|
13
|
+
readonly [documentIdBrand]: never;
|
|
14
|
+
};
|
|
15
|
+
export interface IdentityInput {
|
|
16
|
+
readonly id: string;
|
|
17
|
+
readonly displayName?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ArchitectureIdentity {
|
|
20
|
+
readonly kind: "architecture";
|
|
21
|
+
readonly id: ArchitectureId;
|
|
22
|
+
}
|
|
23
|
+
export interface ObjectIdentity {
|
|
24
|
+
readonly kind: "object";
|
|
25
|
+
readonly id: ObjectId;
|
|
26
|
+
}
|
|
27
|
+
export interface ArchitectureCanonEnvelopeInput {
|
|
28
|
+
readonly documentId: string;
|
|
29
|
+
readonly root: IdentityInput;
|
|
30
|
+
readonly objects?: readonly IdentityInput[];
|
|
31
|
+
}
|
|
32
|
+
export interface ArchitectureCanonEnvelope {
|
|
33
|
+
readonly canonVersion: CanonVersion;
|
|
34
|
+
readonly documentId: DocumentId;
|
|
35
|
+
readonly root: ArchitectureIdentity;
|
|
36
|
+
readonly objects: readonly ObjectIdentity[];
|
|
37
|
+
}
|
|
38
|
+
export { CANON_VERSION };
|
|
39
|
+
export declare function normalizeIdentityId(value: string): string;
|
|
40
|
+
export declare function createArchitectureId(value: string): ArchitectureId;
|
|
41
|
+
export declare function createObjectId(value: string): ObjectId;
|
|
42
|
+
export declare function createDocumentId(value: string): DocumentId;
|
|
43
|
+
export declare function createArchitectureIdentity(input: IdentityInput): ArchitectureIdentity;
|
|
44
|
+
export declare function createObjectIdentity(input: IdentityInput): ObjectIdentity;
|
|
45
|
+
export declare function createArchitectureCanonEnvelope(input: ArchitectureCanonEnvelopeInput): ArchitectureCanonEnvelope;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
const CANON_VERSION = 1;
|
|
2
|
+
export { CANON_VERSION };
|
|
3
|
+
function normalizeId(value, label) {
|
|
4
|
+
if (typeof value !== "string") {
|
|
5
|
+
throw new TypeError(`${label} must be a string`);
|
|
6
|
+
}
|
|
7
|
+
const normalized = value.normalize("NFC");
|
|
8
|
+
if (normalized.length === 0 || /[\p{White_Space}\p{Cc}\p{Cf}\p{Cs}]/u.test(normalized)) {
|
|
9
|
+
throw new TypeError(`${label} is malformed`);
|
|
10
|
+
}
|
|
11
|
+
return normalized;
|
|
12
|
+
}
|
|
13
|
+
function validateIdentityInput(input) {
|
|
14
|
+
if (input === null || typeof input !== "object" || Array.isArray(input)) {
|
|
15
|
+
throw new TypeError("identity must be an object");
|
|
16
|
+
}
|
|
17
|
+
const candidate = input;
|
|
18
|
+
normalizeId(candidate.id, "identity id");
|
|
19
|
+
if (candidate.displayName !== undefined && typeof candidate.displayName !== "string") {
|
|
20
|
+
throw new TypeError("identity displayName must be a string");
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export function normalizeIdentityId(value) {
|
|
24
|
+
return normalizeId(value, "identity id");
|
|
25
|
+
}
|
|
26
|
+
export function createArchitectureId(value) {
|
|
27
|
+
return normalizeIdentityId(value);
|
|
28
|
+
}
|
|
29
|
+
export function createObjectId(value) {
|
|
30
|
+
return normalizeIdentityId(value);
|
|
31
|
+
}
|
|
32
|
+
export function createDocumentId(value) {
|
|
33
|
+
return normalizeId(value, "document id");
|
|
34
|
+
}
|
|
35
|
+
export function createArchitectureIdentity(input) {
|
|
36
|
+
validateIdentityInput(input);
|
|
37
|
+
return Object.freeze({
|
|
38
|
+
kind: "architecture",
|
|
39
|
+
id: createArchitectureId(input.id),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
export function createObjectIdentity(input) {
|
|
43
|
+
validateIdentityInput(input);
|
|
44
|
+
return Object.freeze({
|
|
45
|
+
kind: "object",
|
|
46
|
+
id: createObjectId(input.id),
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
export function createArchitectureCanonEnvelope(input) {
|
|
50
|
+
if (input === null || typeof input !== "object" || Array.isArray(input)) {
|
|
51
|
+
throw new TypeError("canon envelope must be an object");
|
|
52
|
+
}
|
|
53
|
+
const candidate = input;
|
|
54
|
+
const documentId = createDocumentId(candidate.documentId);
|
|
55
|
+
const root = createArchitectureIdentity(candidate.root);
|
|
56
|
+
if (candidate.objects !== undefined &&
|
|
57
|
+
(!Array.isArray(candidate.objects) ||
|
|
58
|
+
candidate.objects.some((object) => object === null || typeof object !== "object"))) {
|
|
59
|
+
throw new TypeError("canon envelope objects must be an array of identities");
|
|
60
|
+
}
|
|
61
|
+
const objects = (candidate.objects ?? []).map((object) => createObjectIdentity(object));
|
|
62
|
+
const objectIds = new Set();
|
|
63
|
+
for (const object of objects) {
|
|
64
|
+
if (objectIds.has(object.id)) {
|
|
65
|
+
throw new Error(`duplicate object id: ${object.id}`);
|
|
66
|
+
}
|
|
67
|
+
objectIds.add(object.id);
|
|
68
|
+
}
|
|
69
|
+
objects.sort((left, right) => {
|
|
70
|
+
if (left.id < right.id)
|
|
71
|
+
return -1;
|
|
72
|
+
if (left.id > right.id)
|
|
73
|
+
return 1;
|
|
74
|
+
return 0;
|
|
75
|
+
});
|
|
76
|
+
return Object.freeze({
|
|
77
|
+
canonVersion: CANON_VERSION,
|
|
78
|
+
documentId,
|
|
79
|
+
root,
|
|
80
|
+
objects: Object.freeze(objects),
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=identity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../../src/architecture/canon/identity.ts"],"names":[],"mappings":"AAAA,MAAM,aAAa,GAAG,CAAU,CAAC;AAuCjC,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,SAAS,WAAW,CAAC,KAAc,EAAE,KAAa;IAChD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,SAAS,CAAC,GAAG,KAAK,mBAAmB,CAAC,CAAC;IACnD,CAAC;IAED,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC1C,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,sCAAsC,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QACvF,MAAM,IAAI,SAAS,CAAC,GAAG,KAAK,eAAe,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,SAAS,qBAAqB,CAAC,KAAc;IAC3C,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,SAAS,CAAC,4BAA4B,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,SAAS,GAAG,KAAgD,CAAC;IACnE,WAAW,CAAC,SAAS,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;IACzC,IAAI,SAAS,CAA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AC;IAEH,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,YAAY,EAAE,aAAa;QAC3B,UAAU;QACV,IAAI;QACJ,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;KAChC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type ObjectId } from "./identity.js";
|
|
2
|
+
import type { ElementRecord } from "./elements.js";
|
|
3
|
+
/** The intentionally small vocabulary of canonical directed relationships. */
|
|
4
|
+
export declare const RELATIONSHIP_KINDS: readonly ["depends-on", "calls", "uses", "data", "control"];
|
|
5
|
+
export type RelationshipKind = (typeof RELATIONSHIP_KINDS)[number];
|
|
6
|
+
export interface InterfaceInput {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly owner: string;
|
|
9
|
+
readonly protocol?: string;
|
|
10
|
+
readonly technology?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface InterfaceRecord {
|
|
13
|
+
readonly id: ObjectId;
|
|
14
|
+
readonly owner: ObjectId;
|
|
15
|
+
readonly protocol?: string;
|
|
16
|
+
readonly technology?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface RelationshipInput {
|
|
19
|
+
readonly source: string;
|
|
20
|
+
readonly target: string;
|
|
21
|
+
readonly kind: RelationshipKind;
|
|
22
|
+
readonly interfaceId?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface RelationshipRecord {
|
|
25
|
+
readonly source: ObjectId;
|
|
26
|
+
readonly target: ObjectId;
|
|
27
|
+
readonly kind: RelationshipKind;
|
|
28
|
+
readonly interfaceId?: ObjectId;
|
|
29
|
+
}
|
|
30
|
+
export interface RelationshipValidationContext {
|
|
31
|
+
readonly elements?: readonly ElementRecord[];
|
|
32
|
+
readonly interfaces?: readonly InterfaceRecord[];
|
|
33
|
+
}
|
|
34
|
+
/** Create one interface/port declaration without resolving its owner. */
|
|
35
|
+
export declare function createInterface(input: InterfaceInput): InterfaceRecord;
|
|
36
|
+
/** Create one directed relationship declaration without resolving its references. */
|
|
37
|
+
export declare function createRelationship(input: RelationshipInput): RelationshipRecord;
|
|
38
|
+
/** Normalize interfaces, rejecting duplicate IDs and optionally unknown owners. */
|
|
39
|
+
export declare function normalizeInterfaces(inputs: readonly InterfaceInput[], elements?: readonly ElementRecord[]): readonly InterfaceRecord[];
|
|
40
|
+
/** Alias matching the single-record constructor naming used by the canon modules. */
|
|
41
|
+
export declare const createInterfaces: typeof normalizeInterfaces;
|
|
42
|
+
/**
|
|
43
|
+
* Normalize directed relationships. References are checked only against the
|
|
44
|
+
* supplied canonical context; no missing element or interface is synthesized.
|
|
45
|
+
*/
|
|
46
|
+
export declare function normalizeRelationships(inputs: readonly RelationshipInput[], context?: RelationshipValidationContext): readonly RelationshipRecord[];
|
|
47
|
+
/** Validate an already-created relationship set without changing its order. */
|
|
48
|
+
export declare function validateRelationships(relationships: readonly RelationshipRecord[], context?: RelationshipValidationContext): void;
|