@@ -18,10 +18,12 @@ import { Diff, DiffAction, DiffType, risky } from '@netcracker/qubership-apihub-
1818import { calculateObjectHash } from './hashes'
1919import { ArrayType , isEmpty } from './arrays'
2020import {
21- ChangeMessage , ChangeSummary ,
21+ ChangeMessage ,
22+ ChangeSummary ,
2223 DiffTypeDto ,
2324 OperationChanges ,
24- OperationChangesDto , OperationType ,
25+ OperationChangesDto ,
26+ OperationType ,
2527 SEMI_BREAKING_CHANGE_TYPE ,
2628 VersionsComparison ,
2729 VersionsComparisonDto ,
@@ -149,26 +151,28 @@ export function toVersionsComparisonDto({
149151 data,
150152 ...rest
151153} : VersionsComparison , logError : ( message : string ) => void ) : VersionsComparisonDto < DiffTypeDto > {
152-
153- console . log ( JSON . stringify ( rest ) )
154154 return {
155155 ...rest ,
156- operationTypes : convertDtoFieldOperationTypes ( rest . operationTypes ) ,
156+ operationTypes : convertDtoFieldOperationTypes ( rest . operationTypes , { origin : risky ,
157+ override : SEMI_BREAKING_CHANGE_TYPE } ) ,
157158 data : data ?. map ( data => toOperationChangesDto ( data , logError ) ) ,
158159 }
159160}
160161
161- export function convertDtoFieldOperationTypes ( operationTypes : ReadonlyArray < OperationType > ) : OperationType < DiffTypeDto > [ ] {
162+ export function convertDtoFieldOperationTypes ( operationTypes : ReadonlyArray < OperationType > , {
163+ origin,
164+ override,
165+ } : OptionDiffReplacer = { origin : SEMI_BREAKING_CHANGE_TYPE , override : risky } ) : OperationType < DiffTypeDto > [ ] {
162166 return operationTypes . map ( ( type ) => {
163167 return {
164168 ...type ,
165169 changesSummary : replacePropertyInChangesSummary ( type . changesSummary , {
166- origin : risky ,
167- override : SEMI_BREAKING_CHANGE_TYPE ,
170+ origin,
171+ override,
168172 } ) ,
169173 numberOfImpactedOperations : replacePropertyInChangesSummary ( type . numberOfImpactedOperations , {
170- origin : risky ,
171- override : SEMI_BREAKING_CHANGE_TYPE ,
174+ origin,
175+ override,
172176 } ) ,
173177 }
174178 } )
0 commit comments