@unispechq/unispec-core 0.3.2 → 0.3.4
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/cache/cache-factory.d.ts +2 -2
- package/dist/cache/cache-factory.js +1 -1
- package/dist/cache/cache-manager.d.ts +2 -2
- package/dist/cache/cache-manager.js +9 -7
- package/dist/cache/hash-utils.d.ts +1 -11
- package/dist/cache/hash-utils.js +1 -21
- package/dist/cache/hashing.d.ts +15 -6
- package/dist/cache/hashing.js +8 -12
- package/dist/cache/index.d.ts +6 -6
- package/dist/cache/index.js +5 -5
- package/dist/cache/lru-cache.d.ts +1 -13
- package/dist/cache/lru-cache.js +3 -24
- package/dist/cjs/cache/cache-factory.js +1 -1
- package/dist/cjs/cache/cache-manager.js +9 -7
- package/dist/cjs/cache/hash-utils.js +1 -23
- package/dist/cjs/cache/hashing.js +7 -13
- package/dist/cjs/cache/index.js +6 -8
- package/dist/cjs/cache/lru-cache.js +3 -24
- package/dist/cjs/diff/annotators.js +3 -2
- package/dist/cjs/diff/core.js +2 -2
- package/dist/cjs/diff/enhanced-diff.js +7 -21
- package/dist/cjs/diff/index.js +8 -8
- package/dist/cjs/errors/config-error.js +1 -1
- package/dist/cjs/errors/error-factory.js +7 -7
- package/dist/cjs/errors/index.js +8 -8
- package/dist/cjs/errors/loader-error.js +1 -1
- package/dist/cjs/errors/reference-error.js +1 -1
- package/dist/cjs/errors/schema-error.js +1 -1
- package/dist/cjs/errors/security-error.js +1 -1
- package/dist/cjs/errors/semantic-error.js +1 -1
- package/dist/cjs/index.js +13 -13
- package/dist/cjs/loader/index.js +4 -4
- package/dist/cjs/loader/security-validator.js +1 -1
- package/dist/cjs/loader/unispec-loader.js +3 -3
- package/dist/cjs/loader/yaml-loader.js +1 -1
- package/dist/cjs/normalizer/core.js +11 -6
- package/dist/cjs/normalizer/index.js +1 -1
- package/dist/cjs/normalizer/utils.js +23 -7
- package/dist/cjs/optimizer/core.js +35 -10
- package/dist/cjs/optimizer/index.js +3 -3
- package/dist/cjs/optimizer/optimization-functions.js +2 -2
- package/dist/cjs/schemas/dedupe.js +27 -14
- package/dist/cjs/schemas/index.js +3 -3
- package/dist/cjs/schemas/resolver.js +3 -2
- package/dist/cjs/validator/ajv-validator.js +1 -1
- package/dist/cjs/validator/config-validator-main.js +4 -4
- package/dist/cjs/validator/config-validator.js +1 -1
- package/dist/cjs/validator/index.js +7 -7
- package/dist/cjs/validator/reference-validator.js +1 -1
- package/dist/cjs/validator/tests-validator.js +2 -2
- package/dist/cjs/validator/unispec-validator.js +7 -11
- package/dist/cjs/validator/validator-factory.js +1 -1
- package/dist/diff/annotators.d.ts +1 -1
- package/dist/diff/annotators.js +3 -2
- package/dist/diff/change-reports.d.ts +1 -1
- package/dist/diff/core.d.ts +2 -2
- package/dist/diff/core.js +2 -2
- package/dist/diff/enhanced-diff.d.ts +3 -3
- package/dist/diff/enhanced-diff.js +7 -21
- package/dist/diff/impact-strategies-refactored.d.ts +2 -2
- package/dist/diff/impact-strategies.d.ts +2 -2
- package/dist/diff/index.d.ts +8 -8
- package/dist/diff/index.js +8 -8
- package/dist/diff/metrics-calculator.d.ts +1 -1
- package/dist/diff/risk-calculator.d.ts +1 -1
- package/dist/diff/suggestion-generator.d.ts +2 -2
- package/dist/errors/config-error.d.ts +1 -1
- package/dist/errors/config-error.js +1 -1
- package/dist/errors/error-factory.d.ts +7 -7
- package/dist/errors/error-factory.js +7 -7
- package/dist/errors/index.d.ts +8 -8
- package/dist/errors/index.js +8 -8
- package/dist/errors/loader-error.d.ts +1 -1
- package/dist/errors/loader-error.js +1 -1
- package/dist/errors/reference-error.d.ts +1 -1
- package/dist/errors/reference-error.js +1 -1
- package/dist/errors/schema-error.d.ts +1 -1
- package/dist/errors/schema-error.js +1 -1
- package/dist/errors/security-error.d.ts +1 -1
- package/dist/errors/security-error.js +1 -1
- package/dist/errors/semantic-error.d.ts +1 -1
- package/dist/errors/semantic-error.js +1 -1
- package/dist/index.cjs +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +13 -13
- package/dist/loader/index.d.ts +5 -5
- package/dist/loader/index.js +4 -4
- package/dist/loader/security-validator.d.ts +1 -1
- package/dist/loader/security-validator.js +1 -1
- package/dist/loader/unispec-loader.d.ts +2 -2
- package/dist/loader/unispec-loader.js +3 -3
- package/dist/loader/yaml-loader.d.ts +1 -1
- package/dist/loader/yaml-loader.js +1 -1
- package/dist/normalizer/core.d.ts +2 -2
- package/dist/normalizer/core.js +11 -6
- package/dist/normalizer/graphql-normalizer.d.ts +1 -1
- package/dist/normalizer/index.d.ts +2 -2
- package/dist/normalizer/index.js +1 -1
- package/dist/normalizer/rest-normalizer.d.ts +1 -1
- package/dist/normalizer/types.d.ts +1 -1
- package/dist/normalizer/utils.d.ts +6 -3
- package/dist/normalizer/utils.js +23 -7
- package/dist/normalizer/websocket-normalizer.d.ts +1 -1
- package/dist/optimizer/core.d.ts +2 -2
- package/dist/optimizer/core.js +35 -10
- package/dist/optimizer/index.d.ts +4 -4
- package/dist/optimizer/index.js +3 -3
- package/dist/optimizer/optimization-functions.d.ts +2 -2
- package/dist/optimizer/optimization-functions.js +2 -2
- package/dist/optimizer/types.d.ts +1 -1
- package/dist/schemas/dedupe.d.ts +1 -1
- package/dist/schemas/dedupe.js +27 -14
- package/dist/schemas/index.d.ts +3 -3
- package/dist/schemas/index.js +3 -3
- package/dist/schemas/resolver.d.ts +1 -1
- package/dist/schemas/resolver.js +3 -2
- package/dist/types/index.d.ts +2 -1
- package/dist/validator/ajv-validator.d.ts +1 -1
- package/dist/validator/ajv-validator.js +1 -1
- package/dist/validator/config-validator-main.d.ts +2 -2
- package/dist/validator/config-validator-main.js +4 -4
- package/dist/validator/config-validator.d.ts +1 -1
- package/dist/validator/config-validator.js +1 -1
- package/dist/validator/index.d.ts +10 -10
- package/dist/validator/index.js +7 -7
- package/dist/validator/reference-validator.d.ts +1 -1
- package/dist/validator/reference-validator.js +1 -1
- package/dist/validator/schema-references.d.ts +1 -1
- package/dist/validator/semantic-validator.d.ts +1 -1
- package/dist/validator/tests-validator.d.ts +2 -2
- package/dist/validator/tests-validator.js +2 -2
- package/dist/validator/types.d.ts +3 -3
- package/dist/validator/unispec-validator.d.ts +2 -2
- package/dist/validator/unispec-validator.js +7 -11
- package/dist/validator/validator-factory.d.ts +3 -3
- package/dist/validator/validator-factory.js +1 -1
- package/package.json +3 -3
- package/dist/cjs/src/cache/cache-factory.js +0 -72
- package/dist/cjs/src/cache/cache-manager.js +0 -128
- package/dist/cjs/src/cache/constants.js +0 -25
- package/dist/cjs/src/cache/hash-utils.js +0 -19
- package/dist/cjs/src/cache/hashing.js +0 -230
- package/dist/cjs/src/cache/index.js +0 -24
- package/dist/cjs/src/cache/lru-cache.js +0 -144
- package/dist/cjs/src/cache/types.js +0 -5
- package/dist/cjs/src/diff/annotators.js +0 -160
- package/dist/cjs/src/diff/change-reports.js +0 -369
- package/dist/cjs/src/diff/core.js +0 -158
- package/dist/cjs/src/diff/enhanced-diff.js +0 -65
- package/dist/cjs/src/diff/impact-strategies-refactored.js +0 -230
- package/dist/cjs/src/diff/impact-strategies.js +0 -219
- package/dist/cjs/src/diff/index.js +0 -27
- package/dist/cjs/src/diff/metrics-calculator.js +0 -69
- package/dist/cjs/src/diff/risk-calculator.js +0 -58
- package/dist/cjs/src/diff/suggestion-generator.js +0 -78
- package/dist/cjs/src/diff/types.js +0 -11
- package/dist/cjs/src/errors/base-error.js +0 -33
- package/dist/cjs/src/errors/config-error.js +0 -11
- package/dist/cjs/src/errors/error-factory.js +0 -48
- package/dist/cjs/src/errors/index.js +0 -19
- package/dist/cjs/src/errors/loader-error.js +0 -11
- package/dist/cjs/src/errors/reference-error.js +0 -11
- package/dist/cjs/src/errors/schema-error.js +0 -11
- package/dist/cjs/src/errors/security-error.js +0 -11
- package/dist/cjs/src/errors/semantic-error.js +0 -11
- package/dist/cjs/src/generated-schemas.js +0 -2100
- package/dist/cjs/src/index.js +0 -59
- package/dist/cjs/src/loader/index.js +0 -13
- package/dist/cjs/src/loader/security-validator.js +0 -53
- package/dist/cjs/src/loader/types.js +0 -11
- package/dist/cjs/src/loader/unispec-loader.js +0 -84
- package/dist/cjs/src/loader/yaml-loader.js +0 -76
- package/dist/cjs/src/normalizer/core.js +0 -37
- package/dist/cjs/src/normalizer/graphql-normalizer.js +0 -67
- package/dist/cjs/src/normalizer/index.js +0 -7
- package/dist/cjs/src/normalizer/rest-normalizer.js +0 -51
- package/dist/cjs/src/normalizer/types.js +0 -2
- package/dist/cjs/src/normalizer/utils.js +0 -49
- package/dist/cjs/src/normalizer/websocket-normalizer.js +0 -81
- package/dist/cjs/src/optimizer/core.js +0 -140
- package/dist/cjs/src/optimizer/index.js +0 -17
- package/dist/cjs/src/optimizer/optimization-functions.js +0 -185
- package/dist/cjs/src/optimizer/types.js +0 -2
- package/dist/cjs/src/optimizer/utils.js +0 -32
- package/dist/cjs/src/schemas/dedupe.js +0 -113
- package/dist/cjs/src/schemas/index.js +0 -14
- package/dist/cjs/src/schemas/resolver.js +0 -42
- package/dist/cjs/src/schemas/utils.js +0 -53
- package/dist/cjs/src/types/index.js +0 -2
- package/dist/cjs/src/validator/ajv-validator.js +0 -82
- package/dist/cjs/src/validator/config-validator-main.js +0 -34
- package/dist/cjs/src/validator/config-validator.js +0 -17
- package/dist/cjs/src/validator/index.js +0 -23
- package/dist/cjs/src/validator/object-traversal.js +0 -112
- package/dist/cjs/src/validator/reference-validator.js +0 -233
- package/dist/cjs/src/validator/schema-references.js +0 -116
- package/dist/cjs/src/validator/semantic-validator.js +0 -328
- package/dist/cjs/src/validator/tests-validator.js +0 -16
- package/dist/cjs/src/validator/types.js +0 -2
- package/dist/cjs/src/validator/unispec-validator.js +0 -80
- package/dist/cjs/src/validator/validator-factory.js +0 -77
- package/dist/cjs/src/versions.js +0 -147
- package/dist/cjs/tests/cache/cache.test.js +0 -274
- package/dist/cjs/tests/cache/utils.js +0 -32
- package/dist/cjs/tests/concurrency-normalizer-optimizer.test.js +0 -1
- package/dist/cjs/tests/diff/diff-annotators.test.js +0 -280
- package/dist/cjs/tests/diff/diff-comprehensive.test.js +0 -262
- package/dist/cjs/tests/diff/diff-extended.test.js +0 -235
- package/dist/cjs/tests/diff/diff.test.js +0 -189
- package/dist/cjs/tests/diff/utils.js +0 -8
- package/dist/cjs/tests/errors/errors-integration.test.js +0 -173
- package/dist/cjs/tests/errors/errors.test.js +0 -280
- package/dist/cjs/tests/errors/utils.js +0 -7
- package/dist/cjs/tests/loader/integration.test.js +0 -216
- package/dist/cjs/tests/loader/loader.test.js +0 -341
- package/dist/cjs/tests/normalizer/normalizer-comprehensive.test.js +0 -648
- package/dist/cjs/tests/normalizer/normalizer-invalid.test.js +0 -258
- package/dist/cjs/tests/normalizer/normalizer-valid.test.js +0 -238
- package/dist/cjs/tests/normalizer/utils.js +0 -47
- package/dist/cjs/tests/optimizer/compress-references.test.js +0 -304
- package/dist/cjs/tests/optimizer/deduplication.test.js +0 -132
- package/dist/cjs/tests/optimizer/integration.test.js +0 -131
- package/dist/cjs/tests/optimizer/optimization-report.test.js +0 -222
- package/dist/cjs/tests/optimizer/optimize-document.test.js +0 -187
- package/dist/cjs/tests/optimizer/orphaned-schemas.test.js +0 -194
- package/dist/cjs/tests/optimizer/sort-schemas.test.js +0 -131
- package/dist/cjs/tests/optimizer/utils.js +0 -209
- package/dist/cjs/tests/schemas/schemas-edge-cases.test.js +0 -223
- package/dist/cjs/tests/schemas/schemas.test.js +0 -400
- package/dist/cjs/tests/schemas/utils.js +0 -7
- package/dist/cjs/tests/utils.js +0 -131
- package/dist/cjs/tests/validator/config-validator.test.js +0 -78
- package/dist/cjs/tests/validator/debug-config.js +0 -1
- package/dist/cjs/tests/validator/debug-missing-service.js +0 -1
- package/dist/cjs/tests/validator/debug-other-configs.js +0 -1
- package/dist/cjs/tests/validator/debug-references.js +0 -1
- package/dist/cjs/tests/validator/unispec-validator.test.js +0 -103
- package/dist/cjs/tests/validator/utils.js +0 -25
- package/dist/src/cache/cache-factory.d.ts +0 -31
- package/dist/src/cache/cache-factory.js +0 -65
- package/dist/src/cache/cache-manager.d.ts +0 -62
- package/dist/src/cache/cache-manager.js +0 -124
- package/dist/src/cache/constants.d.ts +0 -21
- package/dist/src/cache/constants.js +0 -22
- package/dist/src/cache/hash-utils.d.ts +0 -11
- package/dist/src/cache/hash-utils.js +0 -15
- package/dist/src/cache/hashing.d.ts +0 -28
- package/dist/src/cache/hashing.js +0 -193
- package/dist/src/cache/index.d.ts +0 -6
- package/dist/src/cache/index.js +0 -10
- package/dist/src/cache/lru-cache.d.ts +0 -44
- package/dist/src/cache/lru-cache.js +0 -140
- package/dist/src/cache/types.d.ts +0 -24
- package/dist/src/cache/types.js +0 -4
- package/dist/src/diff/annotators.d.ts +0 -4
- package/dist/src/diff/annotators.js +0 -155
- package/dist/src/diff/change-reports.d.ts +0 -37
- package/dist/src/diff/change-reports.js +0 -366
- package/dist/src/diff/core.d.ts +0 -26
- package/dist/src/diff/core.js +0 -155
- package/dist/src/diff/enhanced-diff.d.ts +0 -51
- package/dist/src/diff/enhanced-diff.js +0 -62
- package/dist/src/diff/impact-strategies-refactored.d.ts +0 -69
- package/dist/src/diff/impact-strategies-refactored.js +0 -223
- package/dist/src/diff/impact-strategies.d.ts +0 -41
- package/dist/src/diff/impact-strategies.js +0 -212
- package/dist/src/diff/index.d.ts +0 -8
- package/dist/src/diff/index.js +0 -11
- package/dist/src/diff/metrics-calculator.d.ts +0 -23
- package/dist/src/diff/metrics-calculator.js +0 -65
- package/dist/src/diff/risk-calculator.d.ts +0 -23
- package/dist/src/diff/risk-calculator.js +0 -55
- package/dist/src/diff/suggestion-generator.d.ts +0 -18
- package/dist/src/diff/suggestion-generator.js +0 -74
- package/dist/src/diff/types.d.ts +0 -24
- package/dist/src/diff/types.js +0 -8
- package/dist/src/errors/base-error.d.ts +0 -20
- package/dist/src/errors/base-error.js +0 -29
- package/dist/src/errors/config-error.d.ts +0 -4
- package/dist/src/errors/config-error.js +0 -7
- package/dist/src/errors/error-factory.d.ts +0 -22
- package/dist/src/errors/error-factory.js +0 -45
- package/dist/src/errors/index.d.ts +0 -8
- package/dist/src/errors/index.js +0 -8
- package/dist/src/errors/loader-error.d.ts +0 -4
- package/dist/src/errors/loader-error.js +0 -7
- package/dist/src/errors/reference-error.d.ts +0 -4
- package/dist/src/errors/reference-error.js +0 -7
- package/dist/src/errors/schema-error.d.ts +0 -4
- package/dist/src/errors/schema-error.js +0 -7
- package/dist/src/errors/security-error.d.ts +0 -4
- package/dist/src/errors/security-error.js +0 -7
- package/dist/src/errors/semantic-error.d.ts +0 -4
- package/dist/src/errors/semantic-error.js +0 -7
- package/dist/src/generated-schemas.d.ts +0 -2073
- package/dist/src/generated-schemas.js +0 -2097
- package/dist/src/index.d.ts +0 -13
- package/dist/src/index.js +0 -43
- package/dist/src/loader/index.d.ts +0 -5
- package/dist/src/loader/index.js +0 -5
- package/dist/src/loader/security-validator.d.ts +0 -5
- package/dist/src/loader/security-validator.js +0 -50
- package/dist/src/loader/types.d.ts +0 -30
- package/dist/src/loader/types.js +0 -8
- package/dist/src/loader/unispec-loader.d.ts +0 -10
- package/dist/src/loader/unispec-loader.js +0 -81
- package/dist/src/loader/yaml-loader.d.ts +0 -10
- package/dist/src/loader/yaml-loader.js +0 -39
- package/dist/src/normalizer/core.d.ts +0 -24
- package/dist/src/normalizer/core.js +0 -34
- package/dist/src/normalizer/graphql-normalizer.d.ts +0 -8
- package/dist/src/normalizer/graphql-normalizer.js +0 -64
- package/dist/src/normalizer/index.d.ts +0 -2
- package/dist/src/normalizer/index.js +0 -3
- package/dist/src/normalizer/rest-normalizer.d.ts +0 -8
- package/dist/src/normalizer/rest-normalizer.js +0 -48
- package/dist/src/normalizer/types.d.ts +0 -7
- package/dist/src/normalizer/types.js +0 -1
- package/dist/src/normalizer/utils.d.ts +0 -17
- package/dist/src/normalizer/utils.js +0 -45
- package/dist/src/normalizer/websocket-normalizer.d.ts +0 -8
- package/dist/src/normalizer/websocket-normalizer.js +0 -78
- package/dist/src/optimizer/core.d.ts +0 -17
- package/dist/src/optimizer/core.js +0 -136
- package/dist/src/optimizer/index.d.ts +0 -4
- package/dist/src/optimizer/index.js +0 -7
- package/dist/src/optimizer/optimization-functions.d.ts +0 -32
- package/dist/src/optimizer/optimization-functions.js +0 -179
- package/dist/src/optimizer/types.d.ts +0 -28
- package/dist/src/optimizer/types.js +0 -1
- package/dist/src/optimizer/utils.d.ts +0 -7
- package/dist/src/optimizer/utils.js +0 -29
- package/dist/src/schemas/dedupe.d.ts +0 -9
- package/dist/src/schemas/dedupe.js +0 -110
- package/dist/src/schemas/index.d.ts +0 -3
- package/dist/src/schemas/index.js +0 -6
- package/dist/src/schemas/resolver.d.ts +0 -19
- package/dist/src/schemas/resolver.js +0 -38
- package/dist/src/schemas/utils.d.ts +0 -20
- package/dist/src/schemas/utils.js +0 -49
- package/dist/src/types/index.d.ts +0 -434
- package/dist/src/types/index.js +0 -1
- package/dist/src/validator/ajv-validator.d.ts +0 -15
- package/dist/src/validator/ajv-validator.js +0 -75
- package/dist/src/validator/config-validator-main.d.ts +0 -10
- package/dist/src/validator/config-validator-main.js +0 -31
- package/dist/src/validator/config-validator.d.ts +0 -5
- package/dist/src/validator/config-validator.js +0 -14
- package/dist/src/validator/index.d.ts +0 -10
- package/dist/src/validator/index.js +0 -11
- package/dist/src/validator/object-traversal.d.ts +0 -52
- package/dist/src/validator/object-traversal.js +0 -104
- package/dist/src/validator/reference-validator.d.ts +0 -31
- package/dist/src/validator/reference-validator.js +0 -230
- package/dist/src/validator/schema-references.d.ts +0 -23
- package/dist/src/validator/schema-references.js +0 -111
- package/dist/src/validator/semantic-validator.d.ts +0 -26
- package/dist/src/validator/semantic-validator.js +0 -325
- package/dist/src/validator/tests-validator.d.ts +0 -9
- package/dist/src/validator/tests-validator.js +0 -13
- package/dist/src/validator/types.d.ts +0 -29
- package/dist/src/validator/types.js +0 -1
- package/dist/src/validator/unispec-validator.d.ts +0 -15
- package/dist/src/validator/unispec-validator.js +0 -77
- package/dist/src/validator/validator-factory.d.ts +0 -10
- package/dist/src/validator/validator-factory.js +0 -73
- package/dist/src/versions.d.ts +0 -10
- package/dist/src/versions.js +0 -143
- package/dist/tests/cache/cache.test.d.ts +0 -1
- package/dist/tests/cache/cache.test.js +0 -269
- package/dist/tests/cache/utils.d.ts +0 -4
- package/dist/tests/cache/utils.js +0 -24
- package/dist/tests/concurrency-normalizer-optimizer.test.d.ts +0 -0
- package/dist/tests/concurrency-normalizer-optimizer.test.js +0 -1
- package/dist/tests/diff/diff-annotators.test.d.ts +0 -1
- package/dist/tests/diff/diff-annotators.test.js +0 -275
- package/dist/tests/diff/diff-comprehensive.test.d.ts +0 -1
- package/dist/tests/diff/diff-comprehensive.test.js +0 -257
- package/dist/tests/diff/diff-extended.test.d.ts +0 -1
- package/dist/tests/diff/diff-extended.test.js +0 -230
- package/dist/tests/diff/diff.test.d.ts +0 -1
- package/dist/tests/diff/diff.test.js +0 -184
- package/dist/tests/diff/utils.d.ts +0 -2
- package/dist/tests/diff/utils.js +0 -3
- package/dist/tests/errors/errors-integration.test.d.ts +0 -1
- package/dist/tests/errors/errors-integration.test.js +0 -168
- package/dist/tests/errors/errors.test.d.ts +0 -1
- package/dist/tests/errors/errors.test.js +0 -275
- package/dist/tests/errors/utils.d.ts +0 -2
- package/dist/tests/errors/utils.js +0 -3
- package/dist/tests/loader/integration.test.d.ts +0 -1
- package/dist/tests/loader/integration.test.js +0 -211
- package/dist/tests/loader/loader.test.d.ts +0 -1
- package/dist/tests/loader/loader.test.js +0 -336
- package/dist/tests/normalizer/normalizer-comprehensive.test.d.ts +0 -1
- package/dist/tests/normalizer/normalizer-comprehensive.test.js +0 -643
- package/dist/tests/normalizer/normalizer-invalid.test.d.ts +0 -1
- package/dist/tests/normalizer/normalizer-invalid.test.js +0 -253
- package/dist/tests/normalizer/normalizer-valid.test.d.ts +0 -1
- package/dist/tests/normalizer/normalizer-valid.test.js +0 -233
- package/dist/tests/normalizer/utils.d.ts +0 -18
- package/dist/tests/normalizer/utils.js +0 -36
- package/dist/tests/optimizer/compress-references.test.d.ts +0 -1
- package/dist/tests/optimizer/compress-references.test.js +0 -299
- package/dist/tests/optimizer/deduplication.test.d.ts +0 -1
- package/dist/tests/optimizer/deduplication.test.js +0 -127
- package/dist/tests/optimizer/integration.test.d.ts +0 -1
- package/dist/tests/optimizer/integration.test.js +0 -126
- package/dist/tests/optimizer/optimization-report.test.d.ts +0 -1
- package/dist/tests/optimizer/optimization-report.test.js +0 -217
- package/dist/tests/optimizer/optimize-document.test.d.ts +0 -1
- package/dist/tests/optimizer/optimize-document.test.js +0 -182
- package/dist/tests/optimizer/orphaned-schemas.test.d.ts +0 -1
- package/dist/tests/optimizer/orphaned-schemas.test.js +0 -189
- package/dist/tests/optimizer/sort-schemas.test.d.ts +0 -1
- package/dist/tests/optimizer/sort-schemas.test.js +0 -126
- package/dist/tests/optimizer/utils.d.ts +0 -8
- package/dist/tests/optimizer/utils.js +0 -199
- package/dist/tests/schemas/schemas-edge-cases.test.d.ts +0 -1
- package/dist/tests/schemas/schemas-edge-cases.test.js +0 -218
- package/dist/tests/schemas/schemas.test.d.ts +0 -1
- package/dist/tests/schemas/schemas.test.js +0 -395
- package/dist/tests/schemas/utils.d.ts +0 -2
- package/dist/tests/schemas/utils.js +0 -3
- package/dist/tests/utils.d.ts +0 -10
- package/dist/tests/utils.js +0 -118
- package/dist/tests/validator/config-validator.test.d.ts +0 -1
- package/dist/tests/validator/config-validator.test.js +0 -73
- package/dist/tests/validator/debug-config.d.ts +0 -0
- package/dist/tests/validator/debug-config.js +0 -1
- package/dist/tests/validator/debug-missing-service.d.ts +0 -0
- package/dist/tests/validator/debug-missing-service.js +0 -1
- package/dist/tests/validator/debug-other-configs.d.ts +0 -0
- package/dist/tests/validator/debug-other-configs.js +0 -1
- package/dist/tests/validator/debug-references.d.ts +0 -0
- package/dist/tests/validator/debug-references.js +0 -1
- package/dist/tests/validator/unispec-validator.test.d.ts +0 -1
- package/dist/tests/validator/unispec-validator.test.js +0 -98
- package/dist/tests/validator/utils.d.ts +0 -6
- package/dist/tests/validator/utils.js +0 -20
|
@@ -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 };
|
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* REST route impact analysis strategy.
|
|
3
|
-
*/
|
|
4
|
-
export class RestRouteImpactStrategy {
|
|
5
|
-
analyze(change) {
|
|
6
|
-
const impact = {
|
|
7
|
-
backwardCompatibility: "unknown",
|
|
8
|
-
clientImpact: "none",
|
|
9
|
-
serverImpact: "none",
|
|
10
|
-
migrationComplexity: "none",
|
|
11
|
-
};
|
|
12
|
-
// Route removal is always breaking
|
|
13
|
-
if (change.description === "Item removed" &&
|
|
14
|
-
change.kind?.includes("route.removed")) {
|
|
15
|
-
impact.backwardCompatibility = "incompatible";
|
|
16
|
-
impact.clientImpact = "high";
|
|
17
|
-
impact.serverImpact = "medium";
|
|
18
|
-
impact.migrationComplexity = "complex";
|
|
19
|
-
}
|
|
20
|
-
// Route addition is non-breaking
|
|
21
|
-
if (change.description === "Item added" &&
|
|
22
|
-
change.kind?.includes("route.added")) {
|
|
23
|
-
impact.backwardCompatibility = "compatible";
|
|
24
|
-
impact.clientImpact = "none";
|
|
25
|
-
impact.serverImpact = "low";
|
|
26
|
-
impact.migrationComplexity = "none";
|
|
27
|
-
}
|
|
28
|
-
// Method change is breaking
|
|
29
|
-
if (change.path.includes("/method") &&
|
|
30
|
-
change.description === "Value changed") {
|
|
31
|
-
impact.backwardCompatibility = "incompatible";
|
|
32
|
-
impact.clientImpact = "high";
|
|
33
|
-
impact.serverImpact = "medium";
|
|
34
|
-
impact.migrationComplexity = "moderate";
|
|
35
|
-
}
|
|
36
|
-
// Path change is breaking
|
|
37
|
-
if (change.path.includes("/path") &&
|
|
38
|
-
change.description === "Value changed") {
|
|
39
|
-
impact.backwardCompatibility = "incompatible";
|
|
40
|
-
impact.clientImpact = "high";
|
|
41
|
-
impact.serverImpact = "medium";
|
|
42
|
-
impact.migrationComplexity = "moderate";
|
|
43
|
-
}
|
|
44
|
-
// Required parameter change is breaking
|
|
45
|
-
if (change.path.includes("/required") &&
|
|
46
|
-
change.description === "Value changed") {
|
|
47
|
-
impact.backwardCompatibility = "incompatible";
|
|
48
|
-
impact.clientImpact = "medium";
|
|
49
|
-
impact.serverImpact = "low";
|
|
50
|
-
impact.migrationComplexity = "simple";
|
|
51
|
-
}
|
|
52
|
-
// Response status code removal is breaking
|
|
53
|
-
if (change.path.includes("/responses/") &&
|
|
54
|
-
change.description === "Item removed") {
|
|
55
|
-
impact.backwardCompatibility = "incompatible";
|
|
56
|
-
impact.clientImpact = "medium";
|
|
57
|
-
impact.serverImpact = "low";
|
|
58
|
-
impact.migrationComplexity = "simple";
|
|
59
|
-
}
|
|
60
|
-
// Adding optional parameter is non-breaking
|
|
61
|
-
if (change.path.includes("/queryParams/") &&
|
|
62
|
-
change.description === "Item added") {
|
|
63
|
-
impact.backwardCompatibility = "compatible";
|
|
64
|
-
impact.clientImpact = "none";
|
|
65
|
-
impact.serverImpact = "low";
|
|
66
|
-
impact.migrationComplexity = "none";
|
|
67
|
-
}
|
|
68
|
-
return impact;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* GraphQL operation impact analysis strategy.
|
|
73
|
-
*/
|
|
74
|
-
export class GraphQLOperationImpactStrategy {
|
|
75
|
-
analyze(change) {
|
|
76
|
-
const impact = {
|
|
77
|
-
backwardCompatibility: "unknown",
|
|
78
|
-
clientImpact: "none",
|
|
79
|
-
serverImpact: "none",
|
|
80
|
-
migrationComplexity: "none",
|
|
81
|
-
};
|
|
82
|
-
// Operation removal is breaking
|
|
83
|
-
if (change.description === "Item removed" &&
|
|
84
|
-
change.kind?.includes("operation.removed")) {
|
|
85
|
-
impact.backwardCompatibility = "incompatible";
|
|
86
|
-
impact.clientImpact = "high";
|
|
87
|
-
impact.serverImpact = "medium";
|
|
88
|
-
impact.migrationComplexity = "complex";
|
|
89
|
-
}
|
|
90
|
-
// Operation addition is non-breaking
|
|
91
|
-
if (change.description === "Item added" &&
|
|
92
|
-
change.kind?.includes("operation.added")) {
|
|
93
|
-
impact.backwardCompatibility = "compatible";
|
|
94
|
-
impact.clientImpact = "none";
|
|
95
|
-
impact.serverImpact = "low";
|
|
96
|
-
impact.migrationComplexity = "none";
|
|
97
|
-
}
|
|
98
|
-
// Return type change is breaking
|
|
99
|
-
if (change.path.includes("/returnType") &&
|
|
100
|
-
change.description === "Value changed") {
|
|
101
|
-
impact.backwardCompatibility = "incompatible";
|
|
102
|
-
impact.clientImpact = "high";
|
|
103
|
-
impact.serverImpact = "medium";
|
|
104
|
-
impact.migrationComplexity = "moderate";
|
|
105
|
-
}
|
|
106
|
-
// Adding optional argument is non-breaking
|
|
107
|
-
if (change.path.includes("/args/") && change.description === "Item added") {
|
|
108
|
-
impact.backwardCompatibility = "compatible";
|
|
109
|
-
impact.clientImpact = "none";
|
|
110
|
-
impact.serverImpact = "low";
|
|
111
|
-
impact.migrationComplexity = "none";
|
|
112
|
-
}
|
|
113
|
-
// Making argument required is breaking
|
|
114
|
-
if (change.path.includes("/args/") &&
|
|
115
|
-
change.path.includes("/required") &&
|
|
116
|
-
change.description === "Value changed") {
|
|
117
|
-
impact.backwardCompatibility = "incompatible";
|
|
118
|
-
impact.clientImpact = "medium";
|
|
119
|
-
impact.serverImpact = "low";
|
|
120
|
-
impact.migrationComplexity = "simple";
|
|
121
|
-
}
|
|
122
|
-
return impact;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* WebSocket impact analysis strategy.
|
|
127
|
-
*/
|
|
128
|
-
export class WebSocketImpactStrategy {
|
|
129
|
-
analyze(change) {
|
|
130
|
-
const impact = {
|
|
131
|
-
backwardCompatibility: "unknown",
|
|
132
|
-
clientImpact: "none",
|
|
133
|
-
serverImpact: "none",
|
|
134
|
-
migrationComplexity: "none",
|
|
135
|
-
};
|
|
136
|
-
// Channel removal is breaking
|
|
137
|
-
if (change.description === "Item removed" &&
|
|
138
|
-
change.kind?.includes("channel.removed")) {
|
|
139
|
-
impact.backwardCompatibility = "incompatible";
|
|
140
|
-
impact.clientImpact = "high";
|
|
141
|
-
impact.serverImpact = "medium";
|
|
142
|
-
impact.migrationComplexity = "complex";
|
|
143
|
-
}
|
|
144
|
-
// Channel addition is non-breaking
|
|
145
|
-
if (change.description === "Item added" &&
|
|
146
|
-
change.kind?.includes("channel.added")) {
|
|
147
|
-
impact.backwardCompatibility = "compatible";
|
|
148
|
-
impact.clientImpact = "none";
|
|
149
|
-
impact.serverImpact = "low";
|
|
150
|
-
impact.migrationComplexity = "none";
|
|
151
|
-
}
|
|
152
|
-
// Message removal is breaking
|
|
153
|
-
if (change.description === "Item removed" &&
|
|
154
|
-
change.kind?.includes("message.removed")) {
|
|
155
|
-
impact.backwardCompatibility = "incompatible";
|
|
156
|
-
impact.clientImpact = "medium";
|
|
157
|
-
impact.serverImpact = "low";
|
|
158
|
-
impact.migrationComplexity = "moderate";
|
|
159
|
-
}
|
|
160
|
-
// Message addition is non-breaking
|
|
161
|
-
if (change.description === "Item added" &&
|
|
162
|
-
change.kind?.includes("message.added")) {
|
|
163
|
-
impact.backwardCompatibility = "compatible";
|
|
164
|
-
impact.clientImpact = "none";
|
|
165
|
-
impact.serverImpact = "low";
|
|
166
|
-
impact.migrationComplexity = "none";
|
|
167
|
-
}
|
|
168
|
-
// Message schema change is breaking
|
|
169
|
-
if (change.path.includes("/schemaRef") &&
|
|
170
|
-
change.description === "Value changed") {
|
|
171
|
-
impact.backwardCompatibility = "incompatible";
|
|
172
|
-
impact.clientImpact = "medium";
|
|
173
|
-
impact.serverImpact = "low";
|
|
174
|
-
impact.migrationComplexity = "moderate";
|
|
175
|
-
}
|
|
176
|
-
return impact;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Default impact analysis strategy for unknown changes.
|
|
181
|
-
*/
|
|
182
|
-
export class DefaultImpactStrategy {
|
|
183
|
-
analyze(_change) {
|
|
184
|
-
return {
|
|
185
|
-
backwardCompatibility: "unknown",
|
|
186
|
-
clientImpact: "none",
|
|
187
|
-
serverImpact: "none",
|
|
188
|
-
migrationComplexity: "none",
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Factory for creating impact analysis strategies.
|
|
194
|
-
*/
|
|
195
|
-
const ImpactAnalysisStrategyFactory = {
|
|
196
|
-
strategies: new Map([
|
|
197
|
-
["rest", new RestRouteImpactStrategy()],
|
|
198
|
-
["graphql", new GraphQLOperationImpactStrategy()],
|
|
199
|
-
["websocket", new WebSocketImpactStrategy()],
|
|
200
|
-
]),
|
|
201
|
-
getStrategy(protocol) {
|
|
202
|
-
if (!protocol) {
|
|
203
|
-
return new DefaultImpactStrategy();
|
|
204
|
-
}
|
|
205
|
-
const strategy = this.strategies.get(protocol);
|
|
206
|
-
return strategy || new DefaultImpactStrategy();
|
|
207
|
-
},
|
|
208
|
-
registerStrategy(protocol, strategy) {
|
|
209
|
-
this.strategies.set(protocol, strategy);
|
|
210
|
-
},
|
|
211
|
-
};
|
|
212
|
-
export { ImpactAnalysisStrategyFactory };
|
package/dist/src/diff/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from "./change-reports.js";
|
|
2
|
-
export * from "./core.js";
|
|
3
|
-
export * from "./enhanced-diff.js";
|
|
4
|
-
export * from "./impact-strategies-refactored.js";
|
|
5
|
-
export * from "./metrics-calculator.js";
|
|
6
|
-
export * from "./risk-calculator.js";
|
|
7
|
-
export * from "./suggestion-generator.js";
|
|
8
|
-
export * from "./types.js";
|
package/dist/src/diff/index.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// Export types
|
|
2
|
-
export * from "./change-reports.js";
|
|
3
|
-
// Export core functionality
|
|
4
|
-
export * from "./core.js";
|
|
5
|
-
// Export enhanced functionality
|
|
6
|
-
export * from "./enhanced-diff.js";
|
|
7
|
-
export * from "./impact-strategies-refactored.js";
|
|
8
|
-
export * from "./metrics-calculator.js";
|
|
9
|
-
export * from "./risk-calculator.js";
|
|
10
|
-
export * from "./suggestion-generator.js";
|
|
11
|
-
export * from "./types.js";
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { EnhancedUniSpecChange } from "./enhanced-diff.js";
|
|
2
|
-
/**
|
|
3
|
-
* Service for calculating compatibility metrics from enhanced changes.
|
|
4
|
-
*/
|
|
5
|
-
export declare class MetricsCalculatorService {
|
|
6
|
-
/**
|
|
7
|
-
* Calculate compatibility metrics from enhanced changes.
|
|
8
|
-
*/
|
|
9
|
-
calculateMetrics(changes: EnhancedUniSpecChange[]): {
|
|
10
|
-
overallCompatibility: number;
|
|
11
|
-
breakingChangesCount: number;
|
|
12
|
-
nonBreakingChangesCount: number;
|
|
13
|
-
clientCompatibilityScore: number;
|
|
14
|
-
serverCompatibilityScore: number;
|
|
15
|
-
migrationEffort: "moderate" | "minimal" | "significant" | "major";
|
|
16
|
-
};
|
|
17
|
-
private filterBreakingChanges;
|
|
18
|
-
private filterNonBreakingChanges;
|
|
19
|
-
private calculateBreakingScore;
|
|
20
|
-
private calculateClientCompatibilityScore;
|
|
21
|
-
private calculateServerCompatibilityScore;
|
|
22
|
-
private determineMigrationEffort;
|
|
23
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Service for calculating compatibility metrics from enhanced changes.
|
|
3
|
-
*/
|
|
4
|
-
export class MetricsCalculatorService {
|
|
5
|
-
/**
|
|
6
|
-
* Calculate compatibility metrics from enhanced changes.
|
|
7
|
-
*/
|
|
8
|
-
calculateMetrics(changes) {
|
|
9
|
-
const breakingChanges = this.filterBreakingChanges(changes);
|
|
10
|
-
const nonBreakingChanges = this.filterNonBreakingChanges(changes);
|
|
11
|
-
const totalChanges = changes.length;
|
|
12
|
-
const breakingScore = this.calculateBreakingScore(breakingChanges.length, totalChanges);
|
|
13
|
-
const overallCompatibility = Math.max(0, 100 - breakingScore);
|
|
14
|
-
const clientScore = this.calculateClientCompatibilityScore(changes);
|
|
15
|
-
const serverScore = this.calculateServerCompatibilityScore(changes);
|
|
16
|
-
const migrationEffort = this.determineMigrationEffort(breakingChanges, nonBreakingChanges);
|
|
17
|
-
return {
|
|
18
|
-
overallCompatibility: Math.round(overallCompatibility),
|
|
19
|
-
breakingChangesCount: breakingChanges.length,
|
|
20
|
-
nonBreakingChangesCount: nonBreakingChanges.length,
|
|
21
|
-
clientCompatibilityScore: Math.round(clientScore),
|
|
22
|
-
serverCompatibilityScore: Math.round(serverScore),
|
|
23
|
-
migrationEffort,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
filterBreakingChanges(changes) {
|
|
27
|
-
return changes.filter((c) => c.impact.backwardCompatibility === "incompatible");
|
|
28
|
-
}
|
|
29
|
-
filterNonBreakingChanges(changes) {
|
|
30
|
-
return changes.filter((c) => c.impact.backwardCompatibility === "compatible");
|
|
31
|
-
}
|
|
32
|
-
calculateBreakingScore(breakingCount, totalChanges) {
|
|
33
|
-
return totalChanges > 0 ? (breakingCount / totalChanges) * 100 : 0;
|
|
34
|
-
}
|
|
35
|
-
calculateClientCompatibilityScore(changes) {
|
|
36
|
-
const totalChanges = changes.length;
|
|
37
|
-
if (totalChanges === 0)
|
|
38
|
-
return 100;
|
|
39
|
-
const highClientImpact = changes.filter((c) => c.impact.clientImpact === "high").length;
|
|
40
|
-
const mediumClientImpact = changes.filter((c) => c.impact.clientImpact === "medium").length;
|
|
41
|
-
return (100 - (highClientImpact * 50 + mediumClientImpact * 25) / totalChanges);
|
|
42
|
-
}
|
|
43
|
-
calculateServerCompatibilityScore(changes) {
|
|
44
|
-
const totalChanges = changes.length;
|
|
45
|
-
if (totalChanges === 0)
|
|
46
|
-
return 100;
|
|
47
|
-
const highServerImpact = changes.filter((c) => c.impact.serverImpact === "high").length;
|
|
48
|
-
const mediumServerImpact = changes.filter((c) => c.impact.serverImpact === "medium").length;
|
|
49
|
-
return (100 - (highServerImpact * 30 + mediumServerImpact * 15) / totalChanges);
|
|
50
|
-
}
|
|
51
|
-
determineMigrationEffort(breakingChanges, _nonBreakingChanges) {
|
|
52
|
-
const complexMigrations = breakingChanges.filter((c) => c.impact.migrationComplexity === "complex").length;
|
|
53
|
-
const moderateMigrations = breakingChanges.filter((c) => c.impact.migrationComplexity === "moderate").length;
|
|
54
|
-
if (complexMigrations > 0) {
|
|
55
|
-
return "major";
|
|
56
|
-
}
|
|
57
|
-
else if (moderateMigrations > 2) {
|
|
58
|
-
return "significant";
|
|
59
|
-
}
|
|
60
|
-
else if (moderateMigrations > 0 || breakingChanges.length > 3) {
|
|
61
|
-
return "moderate";
|
|
62
|
-
}
|
|
63
|
-
return "minimal";
|
|
64
|
-
}
|
|
65
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { ChangeImpact } from "./enhanced-diff.js";
|
|
2
|
-
export type RiskLevel = "low" | "medium" | "high" | "critical";
|
|
3
|
-
/**
|
|
4
|
-
* Calculator for determining risk levels based on change impact.
|
|
5
|
-
*/
|
|
6
|
-
export declare const RiskLevelCalculator: {
|
|
7
|
-
/**
|
|
8
|
-
* Calculate risk level based on impact.
|
|
9
|
-
*/
|
|
10
|
-
calculate(impact: ChangeImpact): RiskLevel;
|
|
11
|
-
/**
|
|
12
|
-
* Get risk level weight for sorting.
|
|
13
|
-
*/
|
|
14
|
-
getWeight(riskLevel: RiskLevel): number;
|
|
15
|
-
/**
|
|
16
|
-
* Check if risk level requires immediate attention.
|
|
17
|
-
*/
|
|
18
|
-
requiresImmediateAttention(riskLevel: RiskLevel): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Get risk level description.
|
|
21
|
-
*/
|
|
22
|
-
getDescription(riskLevel: RiskLevel): string;
|
|
23
|
-
};
|