1414 * limitations under the License.
1515 */
1616
17- import type {
17+ import {
1818 BuildConfig ,
1919 BuildConfigFile ,
2020 BuildConfigRef ,
@@ -28,6 +28,7 @@ import type {
2828 ResolvedDocuments ,
2929 ResolvedOperations ,
3030 ResolvedVersionOperationsHashMap ,
31+ VALIDATION_RULES_SEVERITY_LEVEL_WARNING ,
3132 VersionId ,
3233} from './types'
3334import {
@@ -50,7 +51,14 @@ import {
5051import type { NotificationMessage , PackageConfig } from './types/package'
5152import { graphqlApiBuilder , REST_API_TYPE , restApiBuilder , textApiBuilder , unknownApiBuilder } from './apitypes'
5253import { filesDiff , findSharedPath , getCompositeKey , getFileExtension , getOperationsList } from './utils'
53- import { BUILD_TYPE , DEFAULT_BATCH_SIZE , MESSAGE_SEVERITY , SUPPORTED_FILE_FORMATS , VERSION_STATUS } from './consts'
54+ import {
55+ BUILD_TYPE ,
56+ DEFAULT_BATCH_SIZE ,
57+ DEFAULT_VALIDATION_RULES_SEVERITY_CONFIG ,
58+ MESSAGE_SEVERITY ,
59+ SUPPORTED_FILE_FORMATS ,
60+ VERSION_STATUS ,
61+ } from './consts'
5462import { unknownParsedFile } from './apitypes/unknown/unknown.parser'
5563import { createVersionPackage } from './components/package'
5664import { compareVersions } from './components/compare'
@@ -90,7 +98,15 @@ export class PackageVersionBuilder implements IPackageVersionBuilder {
9098
9199 constructor ( config : BuildConfig , public params : BuilderParams , fileSources ?: FileSourceMap ) {
92100 this . apiBuilders . push ( restApiBuilder , graphqlApiBuilder , textApiBuilder , unknownApiBuilder )
93- this . config = { previousVersion : '' , previousVersionPackageId : '' , ...config }
101+ this . config = {
102+ previousVersion : '' ,
103+ previousVersionPackageId : '' ,
104+ ...config ,
105+ validationRulesSeverity : {
106+ ...DEFAULT_VALIDATION_RULES_SEVERITY_CONFIG ,
107+ ...config . validationRulesSeverity ,
108+ } ,
109+ }
94110
95111 this . params . configuration = {
96112 batchSize : DEFAULT_BATCH_SIZE ,
@@ -232,11 +248,6 @@ export class PackageVersionBuilder implements IPackageVersionBuilder {
232248
233249 const source = await this . params . resolvers . fileResolver ( fileId )
234250 if ( ! source ) {
235- this . notifications . push ( {
236- severity : MESSAGE_SEVERITY . Error ,
237- message : 'Cannot resolve file' ,
238- fileId : fileId ,
239- } )
240251 return null
241252 }
242253
0 commit comments