@lcem/declarative-type-validator
Advanced tools
Comparing version 0.6.4 to 0.6.5
@@ -6,10 +6,13 @@ # Change Log | ||
## [0.6.4](https://github.com/salesforce/low-code-experience-model/compare/v0.6.3...v0.6.4) (2021-04-30) | ||
## [0.6.5](https://github.com/salesforce/low-code-experience-model/compare/v0.6.4...v0.6.5) (2021-05-11) | ||
**Note:** Version bump only for package @lcem/declarative-type-validator | ||
### Features | ||
* remove scoped schema @W-9209075 ([#17](https://github.com/salesforce/low-code-experience-model/issues/17)) ([ca982f7](https://github.com/salesforce/low-code-experience-model/commit/ca982f7ae30ff22c10fefff17a3e03aae3634df5)) | ||
# [0.6.0](https://git.soma.salesforce.com/BuilderFramework/canonical-ui-metadata/compare/v0.5.6...v0.6.0) (2021-03-29) | ||
@@ -16,0 +19,0 @@ |
@@ -0,1 +1,3 @@ | ||
import Ajv from 'ajv'; | ||
export interface Json { | ||
@@ -7,15 +9,2 @@ [x: string]: string | number | boolean | Date | Json | JsonArray | null; | ||
export declare type AllDataTypes = Json | string | number | boolean | null | undefined; | ||
export interface ScopedSchema { | ||
name?: string; | ||
type?: string; | ||
title?: string; | ||
min?: number; | ||
max?: number; | ||
isRequired?: boolean; | ||
description?: string; | ||
defaultValue?: AllDataTypes; | ||
validator: Validator; | ||
schema: Json; | ||
leafSchema: Json; | ||
} | ||
export interface Keyword { | ||
@@ -27,3 +16,5 @@ name: string; | ||
} | ||
export declare function getScopedSchema(root: Json, scope: string): ScopedSchema | null; | ||
export interface ReferenceSchemaMap { | ||
[index: string]: Json; | ||
} | ||
export declare type ValidationError = Error; | ||
@@ -38,6 +29,7 @@ export interface ValidationResult { | ||
* @param schema Schema to validate against | ||
* @param ajv | ||
*/ | ||
export declare function validate(declarativeType: AllDataTypes, schema: Json): Promise<ValidationResult>; | ||
export declare function validate(declarativeType: AllDataTypes, schema: Json, ajv?: Ajv.Ajv): Promise<ValidationResult>; | ||
export interface Validator { | ||
validate(value?: AllDataTypes): Promise<ValidationResult>; | ||
validate(value?: AllDataTypes, referenceMap?: ReferenceSchemaMap): Promise<ValidationResult>; | ||
getKeywords(keyword: string): Keyword[]; | ||
@@ -56,2 +48,16 @@ setExtensions(keywordExtensions?: ValidatorKeywordExtension[], formatExtensions?: ValidatorFormatExtension[]): void; | ||
} | ||
export interface ValidatorResult { | ||
name?: string; | ||
type?: string; | ||
title?: string; | ||
min?: number; | ||
max?: number; | ||
isRequired?: boolean; | ||
description?: string; | ||
defaultValue?: AllDataTypes; | ||
validator: Validator; | ||
schema: Json; | ||
leafSchema: Json; | ||
} | ||
export declare function getValidator(schema: Json, scope: string, initValue?: Json, referenceMap?: ReferenceSchemaMap): ValidatorResult | null; | ||
export declare function getMin(schema?: Json): number | undefined; | ||
@@ -58,0 +64,0 @@ export declare function getMax(schema?: Json): number | undefined; |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "0.6.4", | ||
"version": "0.6.5", | ||
"main": "dist/index.js", | ||
@@ -8,0 +8,0 @@ "types": "dist/index.d.ts", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
308097
7591