@unispechq/unispec-core 0.3.2 → 0.3.3
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/cjs/src/cache/cache-factory.js +1 -1
- package/dist/cjs/src/cache/cache-manager.js +2 -2
- package/dist/cjs/src/cache/hash-utils.js +1 -1
- package/dist/cjs/src/cache/hashing.js +1 -1
- package/dist/cjs/src/cache/index.js +5 -5
- package/dist/cjs/src/cache/lru-cache.js +1 -1
- package/dist/cjs/src/diff/core.js +2 -2
- package/dist/cjs/src/diff/enhanced-diff.js +5 -5
- package/dist/cjs/src/diff/index.js +8 -8
- package/dist/cjs/src/errors/config-error.js +1 -1
- package/dist/cjs/src/errors/error-factory.js +7 -7
- package/dist/cjs/src/errors/index.js +8 -8
- package/dist/cjs/src/errors/loader-error.js +1 -1
- package/dist/cjs/src/errors/reference-error.js +1 -1
- package/dist/cjs/src/errors/schema-error.js +1 -1
- package/dist/cjs/src/errors/security-error.js +1 -1
- package/dist/cjs/src/errors/semantic-error.js +1 -1
- package/dist/cjs/src/index.js +13 -13
- package/dist/cjs/src/loader/index.js +4 -4
- package/dist/cjs/src/loader/security-validator.js +1 -1
- package/dist/cjs/src/loader/unispec-loader.js +3 -3
- package/dist/cjs/src/loader/yaml-loader.js +1 -1
- package/dist/cjs/src/normalizer/core.js +4 -4
- package/dist/cjs/src/normalizer/index.js +1 -1
- package/dist/cjs/src/optimizer/core.js +2 -2
- package/dist/cjs/src/optimizer/index.js +3 -3
- package/dist/cjs/src/optimizer/optimization-functions.js +2 -2
- package/dist/cjs/src/schemas/dedupe.js +1 -1
- package/dist/cjs/src/schemas/index.js +3 -3
- package/dist/cjs/src/schemas/resolver.js +1 -1
- package/dist/cjs/src/validator/ajv-validator.js +1 -1
- package/dist/cjs/src/validator/config-validator-main.js +4 -4
- package/dist/cjs/src/validator/config-validator.js +1 -1
- package/dist/cjs/src/validator/index.js +7 -7
- package/dist/cjs/src/validator/reference-validator.js +1 -1
- package/dist/cjs/src/validator/tests-validator.js +2 -2
- package/dist/cjs/src/validator/unispec-validator.js +5 -5
- package/dist/cjs/src/validator/validator-factory.js +1 -1
- package/dist/cjs/tests/cache/cache.test.js +4 -4
- package/dist/cjs/tests/cache/utils.js +1 -1
- package/dist/cjs/tests/diff/diff-annotators.test.js +2 -2
- package/dist/cjs/tests/diff/diff-comprehensive.test.js +2 -2
- package/dist/cjs/tests/diff/diff-extended.test.js +2 -2
- package/dist/cjs/tests/diff/diff.test.js +2 -2
- package/dist/cjs/tests/diff/utils.js +1 -1
- package/dist/cjs/tests/errors/errors-integration.test.js +3 -3
- package/dist/cjs/tests/errors/errors.test.js +2 -2
- package/dist/cjs/tests/errors/utils.js +1 -1
- package/dist/cjs/tests/loader/integration.test.js +2 -2
- package/dist/cjs/tests/loader/loader.test.js +2 -2
- package/dist/cjs/tests/normalizer/normalizer-comprehensive.test.js +2 -2
- package/dist/cjs/tests/normalizer/normalizer-invalid.test.js +2 -2
- package/dist/cjs/tests/normalizer/normalizer-valid.test.js +2 -2
- package/dist/cjs/tests/normalizer/utils.js +1 -1
- package/dist/cjs/tests/optimizer/compress-references.test.js +2 -2
- package/dist/cjs/tests/optimizer/deduplication.test.js +2 -2
- package/dist/cjs/tests/optimizer/integration.test.js +3 -3
- package/dist/cjs/tests/optimizer/optimization-report.test.js +2 -2
- package/dist/cjs/tests/optimizer/optimize-document.test.js +2 -2
- package/dist/cjs/tests/optimizer/orphaned-schemas.test.js +2 -2
- package/dist/cjs/tests/optimizer/sort-schemas.test.js +2 -2
- package/dist/cjs/tests/optimizer/utils.js +1 -1
- package/dist/cjs/tests/schemas/schemas-edge-cases.test.js +3 -3
- package/dist/cjs/tests/schemas/schemas.test.js +3 -3
- package/dist/cjs/tests/schemas/utils.js +1 -1
- package/dist/cjs/tests/validator/config-validator.test.js +2 -2
- package/dist/cjs/tests/validator/unispec-validator.test.js +2 -2
- package/dist/cjs/tests/validator/utils.js +1 -1
- package/package.json +1 -1
- package/dist/cache/cache-factory.d.ts +0 -31
- package/dist/cache/cache-factory.js +0 -65
- package/dist/cache/cache-manager.d.ts +0 -62
- package/dist/cache/cache-manager.js +0 -122
- package/dist/cache/constants.d.ts +0 -21
- package/dist/cache/constants.js +0 -22
- package/dist/cache/hash-utils.d.ts +0 -21
- package/dist/cache/hash-utils.js +0 -35
- package/dist/cache/hashing.d.ts +0 -19
- package/dist/cache/hashing.js +0 -197
- package/dist/cache/index.d.ts +0 -6
- package/dist/cache/index.js +0 -10
- package/dist/cache/lru-cache.d.ts +0 -56
- package/dist/cache/lru-cache.js +0 -161
- package/dist/cache/types.d.ts +0 -24
- package/dist/cache/types.js +0 -4
- package/dist/cjs/cache/cache-factory.js +0 -72
- package/dist/cjs/cache/cache-manager.js +0 -126
- package/dist/cjs/cache/constants.js +0 -25
- package/dist/cjs/cache/hash-utils.js +0 -41
- package/dist/cjs/cache/hashing.js +0 -236
- package/dist/cjs/cache/index.js +0 -26
- package/dist/cjs/cache/lru-cache.js +0 -165
- package/dist/cjs/cache/types.js +0 -5
- package/dist/cjs/diff/annotators.js +0 -159
- package/dist/cjs/diff/change-reports.js +0 -369
- package/dist/cjs/diff/core.js +0 -158
- package/dist/cjs/diff/enhanced-diff.js +0 -79
- package/dist/cjs/diff/impact-strategies-refactored.js +0 -230
- package/dist/cjs/diff/impact-strategies.js +0 -219
- package/dist/cjs/diff/index.js +0 -27
- package/dist/cjs/diff/metrics-calculator.js +0 -69
- package/dist/cjs/diff/risk-calculator.js +0 -58
- package/dist/cjs/diff/suggestion-generator.js +0 -78
- package/dist/cjs/diff/types.js +0 -11
- package/dist/cjs/errors/base-error.js +0 -33
- package/dist/cjs/errors/config-error.js +0 -11
- package/dist/cjs/errors/error-factory.js +0 -48
- package/dist/cjs/errors/index.js +0 -19
- package/dist/cjs/errors/loader-error.js +0 -11
- package/dist/cjs/errors/reference-error.js +0 -11
- package/dist/cjs/errors/schema-error.js +0 -11
- package/dist/cjs/errors/security-error.js +0 -11
- package/dist/cjs/errors/semantic-error.js +0 -11
- package/dist/cjs/generated-schemas.js +0 -2100
- package/dist/cjs/index.js +0 -59
- package/dist/cjs/loader/index.js +0 -13
- package/dist/cjs/loader/security-validator.js +0 -53
- package/dist/cjs/loader/types.js +0 -11
- package/dist/cjs/loader/unispec-loader.js +0 -84
- package/dist/cjs/loader/yaml-loader.js +0 -76
- package/dist/cjs/normalizer/core.js +0 -32
- package/dist/cjs/normalizer/graphql-normalizer.js +0 -67
- package/dist/cjs/normalizer/index.js +0 -7
- package/dist/cjs/normalizer/rest-normalizer.js +0 -51
- package/dist/cjs/normalizer/types.js +0 -2
- package/dist/cjs/normalizer/utils.js +0 -33
- package/dist/cjs/normalizer/websocket-normalizer.js +0 -81
- package/dist/cjs/optimizer/core.js +0 -115
- package/dist/cjs/optimizer/index.js +0 -17
- package/dist/cjs/optimizer/optimization-functions.js +0 -185
- package/dist/cjs/optimizer/types.js +0 -2
- package/dist/cjs/optimizer/utils.js +0 -32
- package/dist/cjs/schemas/dedupe.js +0 -100
- package/dist/cjs/schemas/index.js +0 -14
- package/dist/cjs/schemas/resolver.js +0 -41
- package/dist/cjs/schemas/utils.js +0 -53
- package/dist/cjs/types/index.js +0 -2
- package/dist/cjs/validator/ajv-validator.js +0 -82
- package/dist/cjs/validator/config-validator-main.js +0 -34
- package/dist/cjs/validator/config-validator.js +0 -17
- package/dist/cjs/validator/index.js +0 -23
- package/dist/cjs/validator/object-traversal.js +0 -112
- package/dist/cjs/validator/reference-validator.js +0 -233
- package/dist/cjs/validator/schema-references.js +0 -116
- package/dist/cjs/validator/semantic-validator.js +0 -328
- package/dist/cjs/validator/tests-validator.js +0 -16
- package/dist/cjs/validator/types.js +0 -2
- package/dist/cjs/validator/unispec-validator.js +0 -84
- package/dist/cjs/validator/validator-factory.js +0 -77
- package/dist/cjs/versions.js +0 -147
- package/dist/diff/annotators.d.ts +0 -4
- package/dist/diff/annotators.js +0 -154
- package/dist/diff/change-reports.d.ts +0 -37
- package/dist/diff/change-reports.js +0 -366
- package/dist/diff/core.d.ts +0 -26
- package/dist/diff/core.js +0 -155
- package/dist/diff/enhanced-diff.d.ts +0 -51
- package/dist/diff/enhanced-diff.js +0 -76
- package/dist/diff/impact-strategies-refactored.d.ts +0 -69
- package/dist/diff/impact-strategies-refactored.js +0 -223
- package/dist/diff/impact-strategies.d.ts +0 -41
- package/dist/diff/impact-strategies.js +0 -212
- package/dist/diff/index.d.ts +0 -8
- package/dist/diff/index.js +0 -11
- package/dist/diff/metrics-calculator.d.ts +0 -23
- package/dist/diff/metrics-calculator.js +0 -65
- package/dist/diff/risk-calculator.d.ts +0 -23
- package/dist/diff/risk-calculator.js +0 -55
- package/dist/diff/suggestion-generator.d.ts +0 -18
- package/dist/diff/suggestion-generator.js +0 -74
- package/dist/diff/types.d.ts +0 -24
- package/dist/diff/types.js +0 -8
- package/dist/errors/base-error.d.ts +0 -20
- package/dist/errors/base-error.js +0 -29
- package/dist/errors/config-error.d.ts +0 -4
- package/dist/errors/config-error.js +0 -7
- package/dist/errors/error-factory.d.ts +0 -22
- package/dist/errors/error-factory.js +0 -45
- package/dist/errors/index.d.ts +0 -8
- package/dist/errors/index.js +0 -8
- package/dist/errors/loader-error.d.ts +0 -4
- package/dist/errors/loader-error.js +0 -7
- package/dist/errors/reference-error.d.ts +0 -4
- package/dist/errors/reference-error.js +0 -7
- package/dist/errors/schema-error.d.ts +0 -4
- package/dist/errors/schema-error.js +0 -7
- package/dist/errors/security-error.d.ts +0 -4
- package/dist/errors/security-error.js +0 -7
- package/dist/errors/semantic-error.d.ts +0 -4
- package/dist/errors/semantic-error.js +0 -7
- package/dist/generated-schemas.d.ts +0 -2073
- package/dist/generated-schemas.js +0 -2097
- package/dist/index.cjs +0 -59
- package/dist/index.d.ts +0 -13
- package/dist/index.js +0 -43
- package/dist/loader/index.d.ts +0 -5
- package/dist/loader/index.js +0 -5
- package/dist/loader/security-validator.d.ts +0 -5
- package/dist/loader/security-validator.js +0 -50
- package/dist/loader/types.d.ts +0 -30
- package/dist/loader/types.js +0 -8
- package/dist/loader/unispec-loader.d.ts +0 -10
- package/dist/loader/unispec-loader.js +0 -81
- package/dist/loader/yaml-loader.d.ts +0 -10
- package/dist/loader/yaml-loader.js +0 -39
- package/dist/normalizer/core.d.ts +0 -24
- package/dist/normalizer/core.js +0 -29
- package/dist/normalizer/graphql-normalizer.d.ts +0 -8
- package/dist/normalizer/graphql-normalizer.js +0 -64
- package/dist/normalizer/index.d.ts +0 -2
- package/dist/normalizer/index.js +0 -3
- package/dist/normalizer/rest-normalizer.d.ts +0 -8
- package/dist/normalizer/rest-normalizer.js +0 -48
- package/dist/normalizer/types.d.ts +0 -7
- package/dist/normalizer/types.js +0 -1
- package/dist/normalizer/utils.d.ts +0 -14
- package/dist/normalizer/utils.js +0 -29
- package/dist/normalizer/websocket-normalizer.d.ts +0 -8
- package/dist/normalizer/websocket-normalizer.js +0 -78
- package/dist/optimizer/core.d.ts +0 -17
- package/dist/optimizer/core.js +0 -111
- package/dist/optimizer/index.d.ts +0 -4
- package/dist/optimizer/index.js +0 -7
- package/dist/optimizer/optimization-functions.d.ts +0 -32
- package/dist/optimizer/optimization-functions.js +0 -179
- package/dist/optimizer/types.d.ts +0 -28
- package/dist/optimizer/types.js +0 -1
- package/dist/optimizer/utils.d.ts +0 -7
- package/dist/optimizer/utils.js +0 -29
- package/dist/schemas/dedupe.d.ts +0 -9
- package/dist/schemas/dedupe.js +0 -97
- package/dist/schemas/index.d.ts +0 -3
- package/dist/schemas/index.js +0 -6
- package/dist/schemas/resolver.d.ts +0 -19
- package/dist/schemas/resolver.js +0 -37
- package/dist/schemas/utils.d.ts +0 -20
- package/dist/schemas/utils.js +0 -49
- package/dist/types/index.d.ts +0 -433
- package/dist/types/index.js +0 -1
- package/dist/validator/ajv-validator.d.ts +0 -15
- package/dist/validator/ajv-validator.js +0 -75
- package/dist/validator/config-validator-main.d.ts +0 -10
- package/dist/validator/config-validator-main.js +0 -31
- package/dist/validator/config-validator.d.ts +0 -5
- package/dist/validator/config-validator.js +0 -14
- package/dist/validator/index.d.ts +0 -10
- package/dist/validator/index.js +0 -11
- package/dist/validator/object-traversal.d.ts +0 -52
- package/dist/validator/object-traversal.js +0 -104
- package/dist/validator/reference-validator.d.ts +0 -31
- package/dist/validator/reference-validator.js +0 -230
- package/dist/validator/schema-references.d.ts +0 -23
- package/dist/validator/schema-references.js +0 -111
- package/dist/validator/semantic-validator.d.ts +0 -26
- package/dist/validator/semantic-validator.js +0 -325
- package/dist/validator/tests-validator.d.ts +0 -9
- package/dist/validator/tests-validator.js +0 -13
- package/dist/validator/types.d.ts +0 -29
- package/dist/validator/types.js +0 -1
- package/dist/validator/unispec-validator.d.ts +0 -15
- package/dist/validator/unispec-validator.js +0 -81
- package/dist/validator/validator-factory.d.ts +0 -10
- package/dist/validator/validator-factory.js +0 -73
- package/dist/versions.d.ts +0 -10
- package/dist/versions.js +0 -143
package/dist/diff/core.js
DELETED
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import { annotateGraphQLChange, annotateRestChange, annotateWebSocketChange, } from "./annotators.js";
|
|
2
|
-
import { DEFAULT_NAMED_COLLECTION_PATHS, } from "./types.js";
|
|
3
|
-
/**
|
|
4
|
-
* Check if a value is a plain object (not array, null, or other object types).
|
|
5
|
-
*
|
|
6
|
-
* @param value - The value to check
|
|
7
|
-
* @returns true if the value is a plain object, false otherwise
|
|
8
|
-
*/
|
|
9
|
-
function isPlainObject(value) {
|
|
10
|
-
return Object.prototype.toString.call(value) === "[object Object]";
|
|
11
|
-
}
|
|
12
|
-
function diffValues(oldVal, newVal, basePath, out, options = {}) {
|
|
13
|
-
if (oldVal === newVal) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
// Both plain objects → recurse by keys
|
|
17
|
-
if (isPlainObject(oldVal) && isPlainObject(newVal)) {
|
|
18
|
-
const oldKeys = new Set(Object.keys(oldVal));
|
|
19
|
-
const newKeys = new Set(Object.keys(newVal));
|
|
20
|
-
// Removed keys
|
|
21
|
-
for (const key of oldKeys) {
|
|
22
|
-
if (!newKeys.has(key)) {
|
|
23
|
-
out.push({
|
|
24
|
-
path: `${basePath}/${key}`,
|
|
25
|
-
description: "Field removed",
|
|
26
|
-
severity: "unknown",
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
// Added / changed keys
|
|
31
|
-
for (const key of newKeys) {
|
|
32
|
-
const childPath = `${basePath}/${key}`;
|
|
33
|
-
if (!oldKeys.has(key)) {
|
|
34
|
-
out.push({
|
|
35
|
-
path: childPath,
|
|
36
|
-
description: "Field added",
|
|
37
|
-
severity: "unknown",
|
|
38
|
-
});
|
|
39
|
-
continue;
|
|
40
|
-
}
|
|
41
|
-
const shouldRecurse = options.deepComparison !== false;
|
|
42
|
-
if (shouldRecurse) {
|
|
43
|
-
diffValues(oldVal[key], newVal[key], childPath, out, options);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
// Arrays
|
|
49
|
-
if (Array.isArray(oldVal) && Array.isArray(newVal)) {
|
|
50
|
-
// Special handling for UniSpec collections identified by "name"
|
|
51
|
-
const _namedCollectionPaths = options.namedCollectionPaths || DEFAULT_NAMED_COLLECTION_PATHS;
|
|
52
|
-
const isNamedCollection = (options.namedCollectionPaths || [...DEFAULT_NAMED_COLLECTION_PATHS]).includes(basePath) || basePath.endsWith("/messages"); // Handle messages in channels
|
|
53
|
-
if (isNamedCollection) {
|
|
54
|
-
const oldByName = new Map();
|
|
55
|
-
const newByName = new Map();
|
|
56
|
-
for (const item of oldVal) {
|
|
57
|
-
if (item && typeof item === "object" && typeof item.name === "string") {
|
|
58
|
-
oldByName.set(item.name, item);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
for (const item of newVal) {
|
|
62
|
-
if (item && typeof item === "object" && typeof item.name === "string") {
|
|
63
|
-
newByName.set(item.name, item);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
// Removed
|
|
67
|
-
for (const [name, oldItem] of oldByName.entries()) {
|
|
68
|
-
if (!newByName.has(name)) {
|
|
69
|
-
out.push({
|
|
70
|
-
path: `${basePath}/${name}`,
|
|
71
|
-
description: "Item removed",
|
|
72
|
-
severity: "unknown",
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
const newItem = newByName.get(name);
|
|
77
|
-
const shouldRecurse = options.deepComparison !== false;
|
|
78
|
-
if (shouldRecurse) {
|
|
79
|
-
diffValues(oldItem, newItem, `${basePath}/${name}`, out, options);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
// Added
|
|
84
|
-
for (const [name, _newItem] of newByName.entries()) {
|
|
85
|
-
if (!oldByName.has(name)) {
|
|
86
|
-
out.push({
|
|
87
|
-
path: `${basePath}/${name}`,
|
|
88
|
-
description: "Item added",
|
|
89
|
-
severity: "unknown",
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
// Regular array comparison
|
|
96
|
-
const maxLength = Math.max(oldVal.length, newVal.length);
|
|
97
|
-
for (let i = 0; i < maxLength; i++) {
|
|
98
|
-
if (i >= oldVal.length) {
|
|
99
|
-
out.push({
|
|
100
|
-
path: `${basePath}/${i}`,
|
|
101
|
-
description: "Item added",
|
|
102
|
-
severity: "unknown",
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
else if (i >= newVal.length) {
|
|
106
|
-
out.push({
|
|
107
|
-
path: `${basePath}/${i}`,
|
|
108
|
-
description: "Item removed",
|
|
109
|
-
severity: "unknown",
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
const shouldRecurse = options.deepComparison !== false;
|
|
114
|
-
if (shouldRecurse) {
|
|
115
|
-
diffValues(oldVal[i], newVal[i], `${basePath}/${i}`, out, options);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
// Primitive values or different types
|
|
121
|
-
out.push({
|
|
122
|
-
path: basePath,
|
|
123
|
-
description: "Value changed",
|
|
124
|
-
severity: "unknown",
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Compare two UniSpec documents and return detected changes.
|
|
129
|
-
*
|
|
130
|
-
* This function performs a deep comparison between two UniSpec documents
|
|
131
|
-
* and categorizes changes by severity and protocol. Useful for:
|
|
132
|
-
* - API change detection in CI/CD pipelines
|
|
133
|
-
* - Breaking change analysis
|
|
134
|
-
* - Version compatibility checks
|
|
135
|
-
* - Audit trails for API evolution
|
|
136
|
-
*
|
|
137
|
-
* Features:
|
|
138
|
-
* - Detects added/removed fields at any depth
|
|
139
|
-
* - Special handling for named collections (routes, operations, channels)
|
|
140
|
-
* - Severity classification: "breaking" | "non-breaking" | "unknown"
|
|
141
|
-
* - Protocol categorization: "rest" | "graphql" | "websocket"
|
|
142
|
-
* - Detailed change descriptions with JSON paths
|
|
143
|
-
* - Configurable named collection paths and comparison depth
|
|
144
|
-
*
|
|
145
|
-
* @param oldDoc - The previous version of the UniSpec document
|
|
146
|
-
* @param newDoc - The current version of the UniSpec document
|
|
147
|
-
* @param options - Configuration options for diff behavior
|
|
148
|
-
* @returns Object containing all detected changes
|
|
149
|
-
*/
|
|
150
|
-
export function diffUniSpec(oldDoc, newDoc, options = {}) {
|
|
151
|
-
const changes = [];
|
|
152
|
-
diffValues(oldDoc, newDoc, "", changes, options);
|
|
153
|
-
const annotated = changes.map((change) => annotateWebSocketChange(annotateGraphQLChange(annotateRestChange(change))));
|
|
154
|
-
return { changes: annotated };
|
|
155
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { UniSpecDocument } from "../types/index.js";
|
|
2
|
-
import { type RiskLevel } from "./risk-calculator.js";
|
|
3
|
-
import type { UniSpecChange } from "./types.js";
|
|
4
|
-
export interface ChangeImpact {
|
|
5
|
-
backwardCompatibility: "compatible" | "incompatible" | "unknown";
|
|
6
|
-
clientImpact: "none" | "low" | "medium" | "high";
|
|
7
|
-
serverImpact: "none" | "low" | "medium" | "high";
|
|
8
|
-
migrationComplexity: "none" | "simple" | "moderate" | "complex";
|
|
9
|
-
}
|
|
10
|
-
export interface EnhancedUniSpecChange extends UniSpecChange {
|
|
11
|
-
impact: ChangeImpact;
|
|
12
|
-
suggestions: string[];
|
|
13
|
-
examples?: {
|
|
14
|
-
before: UniSpecDocument;
|
|
15
|
-
after: UniSpecDocument;
|
|
16
|
-
};
|
|
17
|
-
riskLevel: RiskLevel;
|
|
18
|
-
}
|
|
19
|
-
export interface CompatibilityMetrics {
|
|
20
|
-
overallCompatibility: number;
|
|
21
|
-
breakingChangesCount: number;
|
|
22
|
-
nonBreakingChangesCount: number;
|
|
23
|
-
clientCompatibilityScore: number;
|
|
24
|
-
serverCompatibilityScore: number;
|
|
25
|
-
migrationEffort: "minimal" | "moderate" | "significant" | "major";
|
|
26
|
-
}
|
|
27
|
-
export interface EnhancedDiffResult {
|
|
28
|
-
changes: EnhancedUniSpecChange[];
|
|
29
|
-
metrics: CompatibilityMetrics;
|
|
30
|
-
summary: {
|
|
31
|
-
totalChanges: number;
|
|
32
|
-
criticalChanges: number;
|
|
33
|
-
highRiskChanges: number;
|
|
34
|
-
mediumRiskChanges: number;
|
|
35
|
-
lowRiskChanges: number;
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Perform enhanced diff analysis with impact assessment and compatibility metrics.
|
|
40
|
-
*
|
|
41
|
-
* This function extends the basic diff functionality with:
|
|
42
|
-
* - Detailed impact analysis for each change
|
|
43
|
-
* - Compatibility metrics
|
|
44
|
-
* - Migration suggestions
|
|
45
|
-
* - Risk assessment
|
|
46
|
-
*
|
|
47
|
-
* @param oldDoc - The previous version of the UniSpec document
|
|
48
|
-
* @param newDoc - The current version of the UniSpec document
|
|
49
|
-
* @returns Enhanced diff result with comprehensive analysis
|
|
50
|
-
*/
|
|
51
|
-
export declare function diffUniSpecEnhanced(oldDoc: UniSpecDocument, newDoc: UniSpecDocument): EnhancedDiffResult;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { diffUniSpec } from "./core.js";
|
|
2
|
-
import { ImpactAnalysisStrategyFactory } from "./impact-strategies-refactored.js";
|
|
3
|
-
import { MetricsCalculatorService } from "./metrics-calculator.js";
|
|
4
|
-
import { RiskLevelCalculator } from "./risk-calculator.js";
|
|
5
|
-
import { SuggestionGeneratorService } from "./suggestion-generator.js";
|
|
6
|
-
/**
|
|
7
|
-
* Service instances for better separation of concerns.
|
|
8
|
-
*/
|
|
9
|
-
const suggestionGenerator = new SuggestionGeneratorService();
|
|
10
|
-
const metricsCalculator = new MetricsCalculatorService();
|
|
11
|
-
/**
|
|
12
|
-
* Generate migration suggestions based on change impact.
|
|
13
|
-
* @deprecated Use SuggestionGeneratorService.generateSuggestions instead
|
|
14
|
-
*/
|
|
15
|
-
function generateSuggestions(change, impact) {
|
|
16
|
-
return suggestionGenerator.generateSuggestions(change, impact);
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Calculate compatibility metrics from enhanced changes.
|
|
20
|
-
* @deprecated Use MetricsCalculatorService.calculateMetrics instead
|
|
21
|
-
*/
|
|
22
|
-
function calculateMetrics(changes) {
|
|
23
|
-
return metricsCalculator.calculateMetrics(changes);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Perform enhanced diff analysis with impact assessment and compatibility metrics.
|
|
27
|
-
*
|
|
28
|
-
* This function extends the basic diff functionality with:
|
|
29
|
-
* - Detailed impact analysis for each change
|
|
30
|
-
* - Compatibility metrics
|
|
31
|
-
* - Migration suggestions
|
|
32
|
-
* - Risk assessment
|
|
33
|
-
*
|
|
34
|
-
* @param oldDoc - The previous version of the UniSpec document
|
|
35
|
-
* @param newDoc - The current version of the UniSpec document
|
|
36
|
-
* @returns Enhanced diff result with comprehensive analysis
|
|
37
|
-
*/
|
|
38
|
-
export function diffUniSpecEnhanced(oldDoc, newDoc) {
|
|
39
|
-
// Get basic diff
|
|
40
|
-
const basicDiff = diffUniSpec(oldDoc, newDoc);
|
|
41
|
-
// Enhance each change with impact analysis using strategy pattern
|
|
42
|
-
const enhancedChanges = basicDiff.changes.map((change) => {
|
|
43
|
-
// Get appropriate strategy for the protocol
|
|
44
|
-
const strategy = ImpactAnalysisStrategyFactory.getStrategy(change.protocol);
|
|
45
|
-
// Analyze impact using strategy
|
|
46
|
-
const impact = strategy.analyze(change);
|
|
47
|
-
// Generate suggestions
|
|
48
|
-
const suggestions = generateSuggestions(change, impact);
|
|
49
|
-
// Calculate risk level using calculator
|
|
50
|
-
const riskLevel = RiskLevelCalculator.calculate(impact);
|
|
51
|
-
return {
|
|
52
|
-
...change,
|
|
53
|
-
impact,
|
|
54
|
-
suggestions,
|
|
55
|
-
riskLevel,
|
|
56
|
-
};
|
|
57
|
-
});
|
|
58
|
-
// Calculate metrics
|
|
59
|
-
const metrics = calculateMetrics(enhancedChanges);
|
|
60
|
-
// Generate summary
|
|
61
|
-
const summary = {
|
|
62
|
-
totalChanges: enhancedChanges.length,
|
|
63
|
-
criticalChanges: enhancedChanges.filter((c) => c.riskLevel === "critical")
|
|
64
|
-
.length,
|
|
65
|
-
highRiskChanges: enhancedChanges.filter((c) => c.riskLevel === "high")
|
|
66
|
-
.length,
|
|
67
|
-
mediumRiskChanges: enhancedChanges.filter((c) => c.riskLevel === "medium")
|
|
68
|
-
.length,
|
|
69
|
-
lowRiskChanges: enhancedChanges.filter((c) => c.riskLevel === "low").length,
|
|
70
|
-
};
|
|
71
|
-
return {
|
|
72
|
-
changes: enhancedChanges,
|
|
73
|
-
metrics,
|
|
74
|
-
summary,
|
|
75
|
-
};
|
|
76
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import type { ChangeImpact } from "./enhanced-diff.js";
|
|
2
|
-
import type { UniSpecChange } from "./types.js";
|
|
3
|
-
/**
|
|
4
|
-
* Strategy interface for analyzing change impact.
|
|
5
|
-
*/
|
|
6
|
-
export interface ImpactAnalysisStrategy {
|
|
7
|
-
analyze(change: UniSpecChange): ChangeImpact;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Base class for impact analysis strategies with common functionality.
|
|
11
|
-
*/
|
|
12
|
-
declare abstract class BaseImpactStrategy implements ImpactAnalysisStrategy {
|
|
13
|
-
protected createDefaultImpact(): ChangeImpact;
|
|
14
|
-
protected setBreakingChange(impact: ChangeImpact, clientImpact?: "low" | "medium" | "high", serverImpact?: "low" | "medium" | "high", migrationComplexity?: "simple" | "moderate" | "complex"): ChangeImpact;
|
|
15
|
-
protected setNonBreakingChange(impact: ChangeImpact, clientImpact?: "none" | "low" | "medium" | "high", serverImpact?: "none" | "low" | "medium" | "high", migrationComplexity?: "none" | "simple" | "moderate" | "complex"): ChangeImpact;
|
|
16
|
-
abstract analyze(change: UniSpecChange): ChangeImpact;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* REST route impact analysis strategy.
|
|
20
|
-
*/
|
|
21
|
-
export declare class RestRouteImpactStrategy extends BaseImpactStrategy {
|
|
22
|
-
analyze(change: UniSpecChange): ChangeImpact;
|
|
23
|
-
private isRouteRemoval;
|
|
24
|
-
private isRouteAddition;
|
|
25
|
-
private isMethodChange;
|
|
26
|
-
private isPathChange;
|
|
27
|
-
private isRequiredParameterChange;
|
|
28
|
-
private isResponseRemoval;
|
|
29
|
-
private isOptionalParameterAddition;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* GraphQL operation impact analysis strategy.
|
|
33
|
-
*/
|
|
34
|
-
export declare class GraphQLOperationImpactStrategy extends BaseImpactStrategy {
|
|
35
|
-
analyze(change: UniSpecChange): ChangeImpact;
|
|
36
|
-
private isOperationRemoval;
|
|
37
|
-
private isOperationAddition;
|
|
38
|
-
private isReturnTypeChange;
|
|
39
|
-
private isOptionalArgumentAddition;
|
|
40
|
-
private isRequiredArgumentChange;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* WebSocket impact analysis strategy.
|
|
44
|
-
*/
|
|
45
|
-
export declare class WebSocketImpactStrategy extends BaseImpactStrategy {
|
|
46
|
-
analyze(change: UniSpecChange): ChangeImpact;
|
|
47
|
-
private isChannelRemoval;
|
|
48
|
-
private isChannelAddition;
|
|
49
|
-
private isMessageRemoval;
|
|
50
|
-
private isMessageAddition;
|
|
51
|
-
private isMessageSchemaChange;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Default impact analysis strategy for unknown changes.
|
|
55
|
-
*/
|
|
56
|
-
export declare class DefaultImpactStrategy extends BaseImpactStrategy {
|
|
57
|
-
analyze(_change: UniSpecChange): ChangeImpact;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Factory for creating impact analysis strategies.
|
|
61
|
-
*/
|
|
62
|
-
declare const ImpactAnalysisStrategyFactory: {
|
|
63
|
-
strategies: Map<string, ImpactAnalysisStrategy>;
|
|
64
|
-
getStrategy(protocol?: string): ImpactAnalysisStrategy;
|
|
65
|
-
registerStrategy(protocol: string, strategy: ImpactAnalysisStrategy): void;
|
|
66
|
-
getAvailableStrategies(): string[];
|
|
67
|
-
clearStrategies(): void;
|
|
68
|
-
};
|
|
69
|
-
export { ImpactAnalysisStrategyFactory };
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base class for impact analysis strategies with common functionality.
|
|
3
|
-
*/
|
|
4
|
-
class BaseImpactStrategy {
|
|
5
|
-
createDefaultImpact() {
|
|
6
|
-
return {
|
|
7
|
-
backwardCompatibility: "unknown",
|
|
8
|
-
clientImpact: "none",
|
|
9
|
-
serverImpact: "none",
|
|
10
|
-
migrationComplexity: "none",
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
setBreakingChange(impact, clientImpact = "high", serverImpact = "medium", migrationComplexity = "moderate") {
|
|
14
|
-
impact.backwardCompatibility = "incompatible";
|
|
15
|
-
impact.clientImpact = clientImpact;
|
|
16
|
-
impact.serverImpact = serverImpact;
|
|
17
|
-
impact.migrationComplexity = migrationComplexity;
|
|
18
|
-
return impact;
|
|
19
|
-
}
|
|
20
|
-
setNonBreakingChange(impact, clientImpact = "none", serverImpact = "low", migrationComplexity = "none") {
|
|
21
|
-
impact.backwardCompatibility = "compatible";
|
|
22
|
-
impact.clientImpact = clientImpact;
|
|
23
|
-
impact.serverImpact = serverImpact;
|
|
24
|
-
impact.migrationComplexity = migrationComplexity;
|
|
25
|
-
return impact;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* REST route impact analysis strategy.
|
|
30
|
-
*/
|
|
31
|
-
export class RestRouteImpactStrategy extends BaseImpactStrategy {
|
|
32
|
-
analyze(change) {
|
|
33
|
-
const impact = this.createDefaultImpact();
|
|
34
|
-
// Route removal is always breaking
|
|
35
|
-
if (this.isRouteRemoval(change)) {
|
|
36
|
-
return this.setBreakingChange(impact, "high", "medium", "complex");
|
|
37
|
-
}
|
|
38
|
-
// Route addition is non-breaking
|
|
39
|
-
if (this.isRouteAddition(change)) {
|
|
40
|
-
return this.setNonBreakingChange(impact, "none", "low", "none");
|
|
41
|
-
}
|
|
42
|
-
// Method change is breaking
|
|
43
|
-
if (this.isMethodChange(change)) {
|
|
44
|
-
return this.setBreakingChange(impact, "high", "medium", "moderate");
|
|
45
|
-
}
|
|
46
|
-
// Path change is breaking
|
|
47
|
-
if (this.isPathChange(change)) {
|
|
48
|
-
return this.setBreakingChange(impact, "high", "medium", "moderate");
|
|
49
|
-
}
|
|
50
|
-
// Required parameter change is breaking
|
|
51
|
-
if (this.isRequiredParameterChange(change)) {
|
|
52
|
-
return this.setBreakingChange(impact, "medium", "low", "simple");
|
|
53
|
-
}
|
|
54
|
-
// Response status code removal is breaking
|
|
55
|
-
if (this.isResponseRemoval(change)) {
|
|
56
|
-
return this.setBreakingChange(impact, "medium", "low", "simple");
|
|
57
|
-
}
|
|
58
|
-
// Adding optional parameter is non-breaking
|
|
59
|
-
if (this.isOptionalParameterAddition(change)) {
|
|
60
|
-
return this.setNonBreakingChange(impact, "none", "low", "none");
|
|
61
|
-
}
|
|
62
|
-
return impact;
|
|
63
|
-
}
|
|
64
|
-
isRouteRemoval(change) {
|
|
65
|
-
return (change.description === "Item removed" &&
|
|
66
|
-
!!change.kind?.includes("route.removed"));
|
|
67
|
-
}
|
|
68
|
-
isRouteAddition(change) {
|
|
69
|
-
return (change.description === "Item added" &&
|
|
70
|
-
!!change.kind?.includes("route.added"));
|
|
71
|
-
}
|
|
72
|
-
isMethodChange(change) {
|
|
73
|
-
return (change.path.includes("/method") && change.description === "Value changed");
|
|
74
|
-
}
|
|
75
|
-
isPathChange(change) {
|
|
76
|
-
return (change.path.includes("/path") && change.description === "Value changed");
|
|
77
|
-
}
|
|
78
|
-
isRequiredParameterChange(change) {
|
|
79
|
-
return (change.path.includes("/required") &&
|
|
80
|
-
change.description === "Value changed");
|
|
81
|
-
}
|
|
82
|
-
isResponseRemoval(change) {
|
|
83
|
-
return (change.path.includes("/responses/") &&
|
|
84
|
-
change.description === "Item removed");
|
|
85
|
-
}
|
|
86
|
-
isOptionalParameterAddition(change) {
|
|
87
|
-
return (change.path.includes("/queryParams/") &&
|
|
88
|
-
change.description === "Item added");
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* GraphQL operation impact analysis strategy.
|
|
93
|
-
*/
|
|
94
|
-
export class GraphQLOperationImpactStrategy extends BaseImpactStrategy {
|
|
95
|
-
analyze(change) {
|
|
96
|
-
const impact = this.createDefaultImpact();
|
|
97
|
-
// Operation removal is breaking
|
|
98
|
-
if (this.isOperationRemoval(change)) {
|
|
99
|
-
return this.setBreakingChange(impact, "high", "medium", "complex");
|
|
100
|
-
}
|
|
101
|
-
// Operation addition is non-breaking
|
|
102
|
-
if (this.isOperationAddition(change)) {
|
|
103
|
-
return this.setNonBreakingChange(impact, "none", "low", "none");
|
|
104
|
-
}
|
|
105
|
-
// Return type change is breaking
|
|
106
|
-
if (this.isReturnTypeChange(change)) {
|
|
107
|
-
return this.setBreakingChange(impact, "high", "medium", "moderate");
|
|
108
|
-
}
|
|
109
|
-
// Adding optional argument is non-breaking
|
|
110
|
-
if (this.isOptionalArgumentAddition(change)) {
|
|
111
|
-
return this.setNonBreakingChange(impact, "none", "low", "none");
|
|
112
|
-
}
|
|
113
|
-
// Making argument required is breaking
|
|
114
|
-
if (this.isRequiredArgumentChange(change)) {
|
|
115
|
-
return this.setBreakingChange(impact, "medium", "low", "simple");
|
|
116
|
-
}
|
|
117
|
-
return impact;
|
|
118
|
-
}
|
|
119
|
-
isOperationRemoval(change) {
|
|
120
|
-
return (change.description === "Item removed" &&
|
|
121
|
-
!!change.kind?.includes("operation.removed"));
|
|
122
|
-
}
|
|
123
|
-
isOperationAddition(change) {
|
|
124
|
-
return (change.description === "Item added" &&
|
|
125
|
-
!!change.kind?.includes("operation.added"));
|
|
126
|
-
}
|
|
127
|
-
isReturnTypeChange(change) {
|
|
128
|
-
return (change.path.includes("/returnType") &&
|
|
129
|
-
change.description === "Value changed");
|
|
130
|
-
}
|
|
131
|
-
isOptionalArgumentAddition(change) {
|
|
132
|
-
return (change.path.includes("/args/") && change.description === "Item added");
|
|
133
|
-
}
|
|
134
|
-
isRequiredArgumentChange(change) {
|
|
135
|
-
return (change.path.includes("/args/") &&
|
|
136
|
-
change.path.includes("/required") &&
|
|
137
|
-
change.description === "Value changed");
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* WebSocket impact analysis strategy.
|
|
142
|
-
*/
|
|
143
|
-
export class WebSocketImpactStrategy extends BaseImpactStrategy {
|
|
144
|
-
analyze(change) {
|
|
145
|
-
const impact = this.createDefaultImpact();
|
|
146
|
-
// Channel removal is breaking
|
|
147
|
-
if (this.isChannelRemoval(change)) {
|
|
148
|
-
return this.setBreakingChange(impact, "high", "medium", "complex");
|
|
149
|
-
}
|
|
150
|
-
// Channel addition is non-breaking
|
|
151
|
-
if (this.isChannelAddition(change)) {
|
|
152
|
-
return this.setNonBreakingChange(impact, "none", "low", "none");
|
|
153
|
-
}
|
|
154
|
-
// Message removal is breaking
|
|
155
|
-
if (this.isMessageRemoval(change)) {
|
|
156
|
-
return this.setBreakingChange(impact, "medium", "low", "moderate");
|
|
157
|
-
}
|
|
158
|
-
// Message addition is non-breaking
|
|
159
|
-
if (this.isMessageAddition(change)) {
|
|
160
|
-
return this.setNonBreakingChange(impact, "none", "low", "none");
|
|
161
|
-
}
|
|
162
|
-
// Message schema change is breaking
|
|
163
|
-
if (this.isMessageSchemaChange(change)) {
|
|
164
|
-
return this.setBreakingChange(impact, "medium", "low", "moderate");
|
|
165
|
-
}
|
|
166
|
-
return impact;
|
|
167
|
-
}
|
|
168
|
-
isChannelRemoval(change) {
|
|
169
|
-
return (change.description === "Item removed" &&
|
|
170
|
-
!!change.kind?.includes("channel.removed"));
|
|
171
|
-
}
|
|
172
|
-
isChannelAddition(change) {
|
|
173
|
-
return (change.description === "Item added" &&
|
|
174
|
-
!!change.kind?.includes("channel.added"));
|
|
175
|
-
}
|
|
176
|
-
isMessageRemoval(change) {
|
|
177
|
-
return (change.description === "Item removed" &&
|
|
178
|
-
!!change.kind?.includes("message.removed"));
|
|
179
|
-
}
|
|
180
|
-
isMessageAddition(change) {
|
|
181
|
-
return (change.description === "Item added" &&
|
|
182
|
-
!!change.kind?.includes("message.added"));
|
|
183
|
-
}
|
|
184
|
-
isMessageSchemaChange(change) {
|
|
185
|
-
return (change.path.includes("/schemaRef") &&
|
|
186
|
-
change.description === "Value changed");
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Default impact analysis strategy for unknown changes.
|
|
191
|
-
*/
|
|
192
|
-
export class DefaultImpactStrategy extends BaseImpactStrategy {
|
|
193
|
-
analyze(_change) {
|
|
194
|
-
return this.createDefaultImpact();
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Factory for creating impact analysis strategies.
|
|
199
|
-
*/
|
|
200
|
-
const ImpactAnalysisStrategyFactory = {
|
|
201
|
-
strategies: new Map([
|
|
202
|
-
["rest", new RestRouteImpactStrategy()],
|
|
203
|
-
["graphql", new GraphQLOperationImpactStrategy()],
|
|
204
|
-
["websocket", new WebSocketImpactStrategy()],
|
|
205
|
-
]),
|
|
206
|
-
getStrategy(protocol) {
|
|
207
|
-
if (!protocol) {
|
|
208
|
-
return new DefaultImpactStrategy();
|
|
209
|
-
}
|
|
210
|
-
const strategy = this.strategies.get(protocol);
|
|
211
|
-
return strategy || new DefaultImpactStrategy();
|
|
212
|
-
},
|
|
213
|
-
registerStrategy(protocol, strategy) {
|
|
214
|
-
this.strategies.set(protocol, strategy);
|
|
215
|
-
},
|
|
216
|
-
getAvailableStrategies() {
|
|
217
|
-
return Array.from(this.strategies.keys());
|
|
218
|
-
},
|
|
219
|
-
clearStrategies() {
|
|
220
|
-
this.strategies.clear();
|
|
221
|
-
},
|
|
222
|
-
};
|
|
223
|
-
export { ImpactAnalysisStrategyFactory };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { ChangeImpact } from "./enhanced-diff.js";
|
|
2
|
-
import type { UniSpecChange } from "./types.js";
|
|
3
|
-
/**
|
|
4
|
-
* Strategy interface for analyzing change impact.
|
|
5
|
-
*/
|
|
6
|
-
export interface ImpactAnalysisStrategy {
|
|
7
|
-
analyze(change: UniSpecChange): ChangeImpact;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* REST route impact analysis strategy.
|
|
11
|
-
*/
|
|
12
|
-
export declare class RestRouteImpactStrategy implements ImpactAnalysisStrategy {
|
|
13
|
-
analyze(change: UniSpecChange): ChangeImpact;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* GraphQL operation impact analysis strategy.
|
|
17
|
-
*/
|
|
18
|
-
export declare class GraphQLOperationImpactStrategy implements ImpactAnalysisStrategy {
|
|
19
|
-
analyze(change: UniSpecChange): ChangeImpact;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* WebSocket impact analysis strategy.
|
|
23
|
-
*/
|
|
24
|
-
export declare class WebSocketImpactStrategy implements ImpactAnalysisStrategy {
|
|
25
|
-
analyze(change: UniSpecChange): ChangeImpact;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Default impact analysis strategy for unknown changes.
|
|
29
|
-
*/
|
|
30
|
-
export declare class DefaultImpactStrategy implements ImpactAnalysisStrategy {
|
|
31
|
-
analyze(_change: UniSpecChange): ChangeImpact;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Factory for creating impact analysis strategies.
|
|
35
|
-
*/
|
|
36
|
-
declare const ImpactAnalysisStrategyFactory: {
|
|
37
|
-
strategies: Map<string, ImpactAnalysisStrategy>;
|
|
38
|
-
getStrategy(protocol?: string): ImpactAnalysisStrategy;
|
|
39
|
-
registerStrategy(protocol: string, strategy: ImpactAnalysisStrategy): void;
|
|
40
|
-
};
|
|
41
|
-
export { ImpactAnalysisStrategyFactory };
|