@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,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Calculator for determining risk levels based on change impact.
|
|
3
|
-
*/
|
|
4
|
-
export const RiskLevelCalculator = {
|
|
5
|
-
/**
|
|
6
|
-
* Calculate risk level based on impact.
|
|
7
|
-
*/
|
|
8
|
-
calculate(impact) {
|
|
9
|
-
// Critical: Breaking changes with high client impact
|
|
10
|
-
if (impact.backwardCompatibility === "incompatible" &&
|
|
11
|
-
impact.clientImpact === "high") {
|
|
12
|
-
return "critical";
|
|
13
|
-
}
|
|
14
|
-
// High: Any breaking change
|
|
15
|
-
if (impact.backwardCompatibility === "incompatible") {
|
|
16
|
-
return "high";
|
|
17
|
-
}
|
|
18
|
-
// Medium: Medium impact on client or server
|
|
19
|
-
if (impact.clientImpact === "medium" || impact.serverImpact === "medium") {
|
|
20
|
-
return "medium";
|
|
21
|
-
}
|
|
22
|
-
// Low: Everything else
|
|
23
|
-
return "low";
|
|
24
|
-
},
|
|
25
|
-
/**
|
|
26
|
-
* Get risk level weight for sorting.
|
|
27
|
-
*/
|
|
28
|
-
getWeight(riskLevel) {
|
|
29
|
-
const weights = {
|
|
30
|
-
critical: 4,
|
|
31
|
-
high: 3,
|
|
32
|
-
medium: 2,
|
|
33
|
-
low: 1,
|
|
34
|
-
};
|
|
35
|
-
return weights[riskLevel];
|
|
36
|
-
},
|
|
37
|
-
/**
|
|
38
|
-
* Check if risk level requires immediate attention.
|
|
39
|
-
*/
|
|
40
|
-
requiresImmediateAttention(riskLevel) {
|
|
41
|
-
return riskLevel === "critical" || riskLevel === "high";
|
|
42
|
-
},
|
|
43
|
-
/**
|
|
44
|
-
* Get risk level description.
|
|
45
|
-
*/
|
|
46
|
-
getDescription(riskLevel) {
|
|
47
|
-
const descriptions = {
|
|
48
|
-
critical: "Critical breaking change requiring immediate action",
|
|
49
|
-
high: "Breaking change that requires attention",
|
|
50
|
-
medium: "Moderate change with some impact",
|
|
51
|
-
low: "Minor change with minimal impact",
|
|
52
|
-
};
|
|
53
|
-
return descriptions[riskLevel];
|
|
54
|
-
},
|
|
55
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { ChangeImpact } from "./enhanced-diff.js";
|
|
2
|
-
import type { UniSpecChange } from "./index.js";
|
|
3
|
-
/**
|
|
4
|
-
* Service for generating migration suggestions based on change impact.
|
|
5
|
-
*/
|
|
6
|
-
export declare class SuggestionGeneratorService {
|
|
7
|
-
/**
|
|
8
|
-
* Generate migration suggestions based on change impact.
|
|
9
|
-
*/
|
|
10
|
-
generateSuggestions(change: UniSpecChange, impact: ChangeImpact): string[];
|
|
11
|
-
private addBreakingChangeSuggestions;
|
|
12
|
-
private addRestBreakingSuggestions;
|
|
13
|
-
private addGraphQLBreakingSuggestions;
|
|
14
|
-
private addWebSocketBreakingSuggestions;
|
|
15
|
-
private addClientImpactSuggestions;
|
|
16
|
-
private addServerImpactSuggestions;
|
|
17
|
-
private addMigrationComplexitySuggestions;
|
|
18
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Service for generating migration suggestions based on change impact.
|
|
3
|
-
*/
|
|
4
|
-
export class SuggestionGeneratorService {
|
|
5
|
-
/**
|
|
6
|
-
* Generate migration suggestions based on change impact.
|
|
7
|
-
*/
|
|
8
|
-
generateSuggestions(change, impact) {
|
|
9
|
-
const suggestions = [];
|
|
10
|
-
this.addBreakingChangeSuggestions(suggestions, change, impact);
|
|
11
|
-
this.addClientImpactSuggestions(suggestions, impact);
|
|
12
|
-
this.addServerImpactSuggestions(suggestions, impact);
|
|
13
|
-
this.addMigrationComplexitySuggestions(suggestions, impact);
|
|
14
|
-
return suggestions;
|
|
15
|
-
}
|
|
16
|
-
addBreakingChangeSuggestions(suggestions, change, impact) {
|
|
17
|
-
if (impact.backwardCompatibility !== "incompatible")
|
|
18
|
-
return;
|
|
19
|
-
suggestions.push("This is a breaking change that requires client updates");
|
|
20
|
-
if (change.protocol === "rest") {
|
|
21
|
-
this.addRestBreakingSuggestions(suggestions, change);
|
|
22
|
-
}
|
|
23
|
-
else if (change.protocol === "graphql") {
|
|
24
|
-
this.addGraphQLBreakingSuggestions(suggestions, change);
|
|
25
|
-
}
|
|
26
|
-
else if (change.protocol === "websocket") {
|
|
27
|
-
this.addWebSocketBreakingSuggestions(suggestions, change);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
addRestBreakingSuggestions(suggestions, change) {
|
|
31
|
-
if (change.kind?.includes("route.removed")) {
|
|
32
|
-
suggestions.push("Consider deprecating the route before removal");
|
|
33
|
-
suggestions.push("Provide alternative endpoint if functionality is still needed");
|
|
34
|
-
}
|
|
35
|
-
if (change.path.includes("/path")) {
|
|
36
|
-
suggestions.push("Maintain backward compatibility by supporting old path");
|
|
37
|
-
suggestions.push("Document migration path for clients");
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
addGraphQLBreakingSuggestions(suggestions, change) {
|
|
41
|
-
if (change.kind?.includes("operation.removed")) {
|
|
42
|
-
suggestions.push("Mark operation as @deprecated before removal");
|
|
43
|
-
suggestions.push("Provide alternative query/mutation if possible");
|
|
44
|
-
}
|
|
45
|
-
if (change.path.includes("/returnType")) {
|
|
46
|
-
suggestions.push("Consider adding new field instead of changing return type");
|
|
47
|
-
suggestions.push("Use union types for multiple possible return types");
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
addWebSocketBreakingSuggestions(suggestions, change) {
|
|
51
|
-
if (change.kind?.includes("channel.removed")) {
|
|
52
|
-
suggestions.push("Notify clients before closing channel");
|
|
53
|
-
suggestions.push("Provide grace period for migration");
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
addClientImpactSuggestions(suggestions, impact) {
|
|
57
|
-
if (impact.clientImpact === "high") {
|
|
58
|
-
suggestions.push("Client code changes are required");
|
|
59
|
-
suggestions.push("Update client documentation");
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
addServerImpactSuggestions(suggestions, impact) {
|
|
63
|
-
if (impact.serverImpact === "medium" || impact.serverImpact === "high") {
|
|
64
|
-
suggestions.push("Server implementation changes required");
|
|
65
|
-
suggestions.push("Update server-side documentation");
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
addMigrationComplexitySuggestions(suggestions, impact) {
|
|
69
|
-
if (impact.migrationComplexity === "complex") {
|
|
70
|
-
suggestions.push("Plan migration in phases");
|
|
71
|
-
suggestions.push("Consider feature flags for gradual rollout");
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
package/dist/src/diff/types.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export type ChangeSeverity = "breaking" | "non-breaking" | "unknown";
|
|
2
|
-
export interface UniSpecChange {
|
|
3
|
-
path: string;
|
|
4
|
-
description: string;
|
|
5
|
-
severity: ChangeSeverity;
|
|
6
|
-
protocol?: "rest" | "graphql" | "websocket";
|
|
7
|
-
kind?: string;
|
|
8
|
-
}
|
|
9
|
-
export interface DiffResult {
|
|
10
|
-
changes: UniSpecChange[];
|
|
11
|
-
}
|
|
12
|
-
export interface DiffOptions {
|
|
13
|
-
/**
|
|
14
|
-
* Custom paths for named collections that should be compared by name instead of index.
|
|
15
|
-
* Defaults to standard UniSpec paths if not provided.
|
|
16
|
-
*/
|
|
17
|
-
namedCollectionPaths?: string[];
|
|
18
|
-
/**
|
|
19
|
-
* Whether to enable deep comparison of nested objects.
|
|
20
|
-
* @default true
|
|
21
|
-
*/
|
|
22
|
-
deepComparison?: boolean;
|
|
23
|
-
}
|
|
24
|
-
export declare const DEFAULT_NAMED_COLLECTION_PATHS: readonly ["/service/protocols/rest/routes", "/service/protocols/websocket/channels", "/service/protocols/graphql/queries", "/service/protocols/graphql/mutations", "/service/protocols/graphql/subscriptions"];
|
package/dist/src/diff/types.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// Default named collection paths for UniSpec
|
|
2
|
-
export const DEFAULT_NAMED_COLLECTION_PATHS = [
|
|
3
|
-
"/service/protocols/rest/routes",
|
|
4
|
-
"/service/protocols/websocket/channels",
|
|
5
|
-
"/service/protocols/graphql/queries",
|
|
6
|
-
"/service/protocols/graphql/mutations",
|
|
7
|
-
"/service/protocols/graphql/subscriptions",
|
|
8
|
-
];
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base validation error class for UniSpec validation.
|
|
3
|
-
* Provides better error context and handling.
|
|
4
|
-
*/
|
|
5
|
-
export declare class UniSpecValidationError extends Error {
|
|
6
|
-
readonly code: string;
|
|
7
|
-
readonly path: string;
|
|
8
|
-
readonly severity: "error" | "warning" | "info";
|
|
9
|
-
readonly details?: Record<string, unknown>;
|
|
10
|
-
constructor(message: string, code: string, path?: string, severity?: "error" | "warning" | "info", details?: Record<string, unknown>);
|
|
11
|
-
toJSON(): {
|
|
12
|
-
name: string;
|
|
13
|
-
message: string;
|
|
14
|
-
code: string;
|
|
15
|
-
path: string;
|
|
16
|
-
severity: "info" | "error" | "warning";
|
|
17
|
-
details: Record<string, unknown> | undefined;
|
|
18
|
-
stack: string | undefined;
|
|
19
|
-
};
|
|
20
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base validation error class for UniSpec validation.
|
|
3
|
-
* Provides better error context and handling.
|
|
4
|
-
*/
|
|
5
|
-
export class UniSpecValidationError extends Error {
|
|
6
|
-
constructor(message, code, path = "", severity = "error", details) {
|
|
7
|
-
super(message);
|
|
8
|
-
this.name = "UniSpecValidationError";
|
|
9
|
-
this.code = code;
|
|
10
|
-
this.path = path;
|
|
11
|
-
this.severity = severity;
|
|
12
|
-
this.details = details;
|
|
13
|
-
// Maintains proper stack trace for where our error was thrown (only available on V8)
|
|
14
|
-
if (Error.captureStackTrace) {
|
|
15
|
-
Error.captureStackTrace(this, UniSpecValidationError);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
toJSON() {
|
|
19
|
-
return {
|
|
20
|
-
name: this.name,
|
|
21
|
-
message: this.message,
|
|
22
|
-
code: this.code,
|
|
23
|
-
path: this.path,
|
|
24
|
-
severity: this.severity,
|
|
25
|
-
details: this.details,
|
|
26
|
-
stack: this.stack,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { UniSpecValidationError } from "./base-error.js";
|
|
2
|
-
export class UniSpecConfigError extends UniSpecValidationError {
|
|
3
|
-
constructor(message, path = "", details) {
|
|
4
|
-
super(message, "config_error", path, "error", details);
|
|
5
|
-
this.name = "UniSpecConfigError";
|
|
6
|
-
}
|
|
7
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { UniSpecValidationError } from "./base-error.js";
|
|
2
|
-
import { UniSpecConfigError } from "./config-error.js";
|
|
3
|
-
import { UniSpecLoaderError } from "./loader-error.js";
|
|
4
|
-
import { UniSpecReferenceError } from "./reference-error.js";
|
|
5
|
-
import { UniSpecSchemaError } from "./schema-error.js";
|
|
6
|
-
import { UniSpecSecurityError } from "./security-error.js";
|
|
7
|
-
import { UniSpecSemanticError } from "./semantic-error.js";
|
|
8
|
-
/**
|
|
9
|
-
* Error factory for creating specific error types.
|
|
10
|
-
*/
|
|
11
|
-
export declare const ErrorFactory: {
|
|
12
|
-
createSchemaError(message: string, path?: string, details?: Record<string, unknown>): UniSpecSchemaError;
|
|
13
|
-
createSemanticError(message: string, path?: string, details?: Record<string, unknown>): UniSpecSemanticError;
|
|
14
|
-
createReferenceError(message: string, path?: string, details?: Record<string, unknown>): UniSpecReferenceError;
|
|
15
|
-
createConfigError(message: string, path?: string, details?: Record<string, unknown>): UniSpecConfigError;
|
|
16
|
-
createSecurityError(message: string, path?: string, details?: Record<string, unknown>): UniSpecSecurityError;
|
|
17
|
-
createLoaderError(message: string, path?: string, details?: Record<string, unknown>): UniSpecLoaderError;
|
|
18
|
-
/**
|
|
19
|
-
* Convert generic error to UniSpecValidationError
|
|
20
|
-
*/
|
|
21
|
-
fromError(error: unknown, defaultCode?: string): UniSpecValidationError;
|
|
22
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { UniSpecValidationError } from "./base-error.js";
|
|
2
|
-
import { UniSpecConfigError } from "./config-error.js";
|
|
3
|
-
import { UniSpecLoaderError } from "./loader-error.js";
|
|
4
|
-
import { UniSpecReferenceError } from "./reference-error.js";
|
|
5
|
-
import { UniSpecSchemaError } from "./schema-error.js";
|
|
6
|
-
import { UniSpecSecurityError } from "./security-error.js";
|
|
7
|
-
import { UniSpecSemanticError } from "./semantic-error.js";
|
|
8
|
-
/**
|
|
9
|
-
* Error factory for creating specific error types.
|
|
10
|
-
*/
|
|
11
|
-
export const ErrorFactory = {
|
|
12
|
-
createSchemaError(message, path, details) {
|
|
13
|
-
return new UniSpecSchemaError(message, path, details);
|
|
14
|
-
},
|
|
15
|
-
createSemanticError(message, path, details) {
|
|
16
|
-
return new UniSpecSemanticError(message, path, details);
|
|
17
|
-
},
|
|
18
|
-
createReferenceError(message, path, details) {
|
|
19
|
-
return new UniSpecReferenceError(message, path, details);
|
|
20
|
-
},
|
|
21
|
-
createConfigError(message, path, details) {
|
|
22
|
-
return new UniSpecConfigError(message, path, details);
|
|
23
|
-
},
|
|
24
|
-
createSecurityError(message, path, details) {
|
|
25
|
-
return new UniSpecSecurityError(message, path, details);
|
|
26
|
-
},
|
|
27
|
-
createLoaderError(message, path, details) {
|
|
28
|
-
return new UniSpecLoaderError(message, path, details);
|
|
29
|
-
},
|
|
30
|
-
/**
|
|
31
|
-
* Convert generic error to UniSpecValidationError
|
|
32
|
-
*/
|
|
33
|
-
fromError(error, defaultCode = "validation_error") {
|
|
34
|
-
if (error instanceof UniSpecValidationError) {
|
|
35
|
-
return error;
|
|
36
|
-
}
|
|
37
|
-
if (error instanceof Error) {
|
|
38
|
-
return new UniSpecValidationError(error.message, defaultCode, "", "error", { originalError: error.name, stack: error.stack });
|
|
39
|
-
}
|
|
40
|
-
if (typeof error === "string") {
|
|
41
|
-
return new UniSpecValidationError(error, defaultCode);
|
|
42
|
-
}
|
|
43
|
-
return new UniSpecValidationError(`Unknown validation error: ${String(error)}`, defaultCode, "", "error", { originalError: error });
|
|
44
|
-
},
|
|
45
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { UniSpecValidationError } from "./base-error.js";
|
|
2
|
-
export { UniSpecConfigError } from "./config-error.js";
|
|
3
|
-
export { ErrorFactory } from "./error-factory.js";
|
|
4
|
-
export { UniSpecLoaderError } from "./loader-error.js";
|
|
5
|
-
export { UniSpecReferenceError } from "./reference-error.js";
|
|
6
|
-
export { UniSpecSchemaError } from "./schema-error.js";
|
|
7
|
-
export { UniSpecSecurityError } from "./security-error.js";
|
|
8
|
-
export { UniSpecSemanticError } from "./semantic-error.js";
|
package/dist/src/errors/index.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { UniSpecValidationError } from "./base-error.js";
|
|
2
|
-
export { UniSpecConfigError } from "./config-error.js";
|
|
3
|
-
export { ErrorFactory } from "./error-factory.js";
|
|
4
|
-
export { UniSpecLoaderError } from "./loader-error.js";
|
|
5
|
-
export { UniSpecReferenceError } from "./reference-error.js";
|
|
6
|
-
export { UniSpecSchemaError } from "./schema-error.js";
|
|
7
|
-
export { UniSpecSecurityError } from "./security-error.js";
|
|
8
|
-
export { UniSpecSemanticError } from "./semantic-error.js";
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { UniSpecValidationError } from "./base-error.js";
|
|
2
|
-
export class UniSpecLoaderError extends UniSpecValidationError {
|
|
3
|
-
constructor(message, path = "", details) {
|
|
4
|
-
super(message, "loader_error", path, "error", details);
|
|
5
|
-
this.name = "UniSpecLoaderError";
|
|
6
|
-
}
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { UniSpecValidationError } from "./base-error.js";
|
|
2
|
-
export class UniSpecReferenceError extends UniSpecValidationError {
|
|
3
|
-
constructor(message, path = "", details) {
|
|
4
|
-
super(message, "reference_error", path, "error", details);
|
|
5
|
-
this.name = "UniSpecReferenceError";
|
|
6
|
-
}
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { UniSpecValidationError } from "./base-error.js";
|
|
2
|
-
export class UniSpecSchemaError extends UniSpecValidationError {
|
|
3
|
-
constructor(message, path = "", details) {
|
|
4
|
-
super(message, "schema_error", path, "error", details);
|
|
5
|
-
this.name = "UniSpecSchemaError";
|
|
6
|
-
}
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { UniSpecValidationError } from "./base-error.js";
|
|
2
|
-
export class UniSpecSecurityError extends UniSpecValidationError {
|
|
3
|
-
constructor(message, path = "", details) {
|
|
4
|
-
super(message, "security_error", path, "error", details);
|
|
5
|
-
this.name = "UniSpecSecurityError";
|
|
6
|
-
}
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { UniSpecValidationError } from "./base-error.js";
|
|
2
|
-
export class UniSpecSemanticError extends UniSpecValidationError {
|
|
3
|
-
constructor(message, path = "", details) {
|
|
4
|
-
super(message, "semantic_error", path, "error", details);
|
|
5
|
-
this.name = "UniSpecSemanticError";
|
|
6
|
-
}
|
|
7
|
-
}
|