@kubernetes-models/flux-cd
Version:
1 lines • 3.27 kB
JavaScript
export const validate=validate3;import{validate as validate1}from"./ComGithubFluxcdPkgApisMetaLocalObjectReference.js";function validate0(data,{instancePath="",parentData,parentDataProperty,rootData=data}={}){let vErrors=null,errors=0;return null!==data&&(validate1(data,{instancePath,parentData,parentDataProperty,rootData})||(errors=(vErrors=null===vErrors?validate1.errors:vErrors.concat(validate1.errors)).length)),validate0.errors=vErrors,0===errors}let pattern0=RegExp("^(http|https)://.*$","u");function validate5(data,{instancePath="",parentData,parentDataProperty,rootData=data}={}){let vErrors=null,errors=0;if("string"==typeof data){if(!pattern0.test(data)){let err0={instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern:"^(http|https)://.*$"}};null===vErrors?vErrors=[err0]:vErrors.push(err0),errors++}}else{let err1={instancePath,schemaPath:"#/type",keyword:"type",params:{type:"string"}};null===vErrors?vErrors=[err1]:vErrors.push(err1),errors++}return validate5.errors=vErrors,0===errors}let schema4_enum=["aws","ldap"];function validate7(data,{instancePath="",parentData,parentDataProperty,rootData=data}={}){let vErrors=null,errors=0;if("string"!=typeof data){let err0={instancePath,schemaPath:"#/type",keyword:"type",params:{type:"string"}};null===vErrors?vErrors=[err0]:vErrors.push(err0),errors++}if("aws"!==data&&"ldap"!==data){let err1={instancePath,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:schema4_enum}};null===vErrors?vErrors=[err1]:vErrors.push(err1),errors++}return validate7.errors=vErrors,0===errors}function validate3(data,{instancePath="",parentData,parentDataProperty,rootData=data}={}){let vErrors=null,errors=0;if(data&&"object"==typeof data&&!Array.isArray(data)){if(void 0===data.endpoint){let err0={instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty:"endpoint"}};null===vErrors?vErrors=[err0]:vErrors.push(err0),errors++}if(void 0===data.provider){let err1={instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty:"provider"}};null===vErrors?vErrors=[err1]:vErrors.push(err1),errors++}void 0!==data.certSecretRef&&(validate0(data.certSecretRef,{instancePath:instancePath+"/certSecretRef",parentData:data,parentDataProperty:"certSecretRef",rootData})||(errors=(vErrors=null===vErrors?validate0.errors:vErrors.concat(validate0.errors)).length)),void 0!==data.endpoint&&(validate5(data.endpoint,{instancePath:instancePath+"/endpoint",parentData:data,parentDataProperty:"endpoint",rootData})||(errors=(vErrors=null===vErrors?validate5.errors:vErrors.concat(validate5.errors)).length)),void 0!==data.provider&&(validate7(data.provider,{instancePath:instancePath+"/provider",parentData:data,parentDataProperty:"provider",rootData})||(errors=(vErrors=null===vErrors?validate7.errors:vErrors.concat(validate7.errors)).length)),void 0!==data.secretRef&&(validate0(data.secretRef,{instancePath:instancePath+"/secretRef",parentData:data,parentDataProperty:"secretRef",rootData})||(errors=(vErrors=null===vErrors?validate0.errors:vErrors.concat(validate0.errors)).length))}else{let err2={instancePath,schemaPath:"#/type",keyword:"type",params:{type:"object"}};null===vErrors?vErrors=[err2]:vErrors.push(err2),errors++}return validate3.errors=vErrors,0===errors}