validatePackage
validatePackage(
source,options?):Promise<{errors:object[];valid:boolean; } | {errors: ({data?:any;instancePath:string;keyword:string;message?:string;params:object;parentSchema?:object;propertyName?:string;resource:string;schema?:any;schemaPath:string;type:"metadata"; } | {fieldNames:string[];resource:string;type:"fields/missing"; } | {fieldNames:string[];resource:string;type:"fields/extra"; } | {actualFieldName:string;fieldName:string;resource:string;type:"field/name"; } | {actualFieldType:FieldType;fieldName:string;fieldType:FieldType;resource:string;type:"field/type"; } | {fieldNames:string[];resource:string;rowNumber:number;type:"row/unique"; } | {cell:string;fieldName:string;resource:string;rowNumber:number;type:"cell/type"; } | {cell:string;fieldName:string;resource:string;rowNumber:number;type:"cell/required"; } | {cell:string;fieldName:string;resource:string;rowNumber:number;type:"cell/minimum"; } | {cell:string;fieldName:string;resource:string;rowNumber:number;type:"cell/maximum"; } | {cell:string;fieldName:string;resource:string;rowNumber:number;type:"cell/exclusiveMinimum"; } | {cell:string;fieldName:string;resource:string;rowNumber:number;type:"cell/exclusiveMaximum"; } | {cell:string;fieldName:string;resource:string;rowNumber:number;type:"cell/minLength"; } | {cell:string;fieldName:string;resource:string;rowNumber:number;type:"cell/maxLength"; } | {cell:string;fieldName:string;resource:string;rowNumber:number;type:"cell/pattern"; } | {cell:string;fieldName:string;resource:string;rowNumber:number;type:"cell/unique"; } | {cell:string;fieldName:string;resource:string;rowNumber:number;type:"cell/enum"; } | {actualBytes:number;bytes:number;resource:string;type:"file/bytes"; } | {actualHash:string;hash:string;resource:string;type:"file/hash"; })[];valid:boolean; }>
Defined in: all/build/package/validate.d.ts:2
Parameters
Section titled “Parameters”source
Section titled “source”string | Descriptor | Partial<Package>
options?
Section titled “options?”basepath?
Section titled “basepath?”string
Returns
Section titled “Returns”Promise<{ errors: object[]; valid: boolean; } | { errors: ({ data?: any; instancePath: string; keyword: string; message?: string; params: object; parentSchema?: object; propertyName?: string; resource: string; schema?: any; schemaPath: string; type: "metadata"; } | { fieldNames: string[]; resource: string; type: "fields/missing"; } | { fieldNames: string[]; resource: string; type: "fields/extra"; } | { actualFieldName: string; fieldName: string; resource: string; type: "field/name"; } | { actualFieldType: FieldType; fieldName: string; fieldType: FieldType; resource: string; type: "field/type"; } | { fieldNames: string[]; resource: string; rowNumber: number; type: "row/unique"; } | { cell: string; fieldName: string; resource: string; rowNumber: number; type: "cell/type"; } | { cell: string; fieldName: string; resource: string; rowNumber: number; type: "cell/required"; } | { cell: string; fieldName: string; resource: string; rowNumber: number; type: "cell/minimum"; } | { cell: string; fieldName: string; resource: string; rowNumber: number; type: "cell/maximum"; } | { cell: string; fieldName: string; resource: string; rowNumber: number; type: "cell/exclusiveMinimum"; } | { cell: string; fieldName: string; resource: string; rowNumber: number; type: "cell/exclusiveMaximum"; } | { cell: string; fieldName: string; resource: string; rowNumber: number; type: "cell/minLength"; } | { cell: string; fieldName: string; resource: string; rowNumber: number; type: "cell/maxLength"; } | { cell: string; fieldName: string; resource: string; rowNumber: number; type: "cell/pattern"; } | { cell: string; fieldName: string; resource: string; rowNumber: number; type: "cell/unique"; } | { cell: string; fieldName: string; resource: string; rowNumber: number; type: "cell/enum"; } | { actualBytes: number; bytes: number; resource: string; type: "file/bytes"; } | { actualHash: string; hash: string; resource: string; type: "file/hash"; })[]; valid: boolean; }>