Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lcem/declarative-type-validator

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lcem/declarative-type-validator - npm Package Compare versions

Comparing version 0.6.5 to 0.6.6

6

CHANGELOG.md

@@ -6,8 +6,8 @@ # Change Log

## [0.6.5](https://github.com/salesforce/low-code-experience-model/compare/v0.6.4...v0.6.5) (2021-05-11)
## [0.6.6](https://github.com/salesforce/low-code-experience-model/compare/v0.6.5...v0.6.6) (2021-05-19)
### Features
### Bug Fixes
* 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))
* add back some scoped schema functionality and move types to schema package @W-9209075 ([#23](https://github.com/salesforce/low-code-experience-model/issues/23)) ([57b9245](https://github.com/salesforce/low-code-experience-model/commit/57b9245b5522c10fd1d1421f12a1dc2a65e7c11d))

@@ -14,0 +14,0 @@

import Ajv from 'ajv';
export type ViewMetadataSchema =
| ComponentWithNoRegion
| ComponentWithRegionMap
| ComponentWithComponentArray;
export type ComponentWithNoRegion = Component & {
[k: string]: any;
};
export type JSONSchemaMetaSchema = CoreSchemaMetaSchema | boolean;
export type ComponentWithRegionMap = Component & {
regions: RegionMap;
[k: string]: any;
};
export type ComponentArray = [ViewMetadataSchema, ...ViewMetadataSchema[]];
export type ComponentWithComponentArray = Component & {
components: ComponentArray;
[k: string]: any;
};
export interface Component {
label?: string;
description?: string;
name?: string;
definition?: string;
schema?: JSONSchemaMetaSchema;
properties?: {
[k: string]: any;
};
[k: string]: any;
}
export interface CoreSchemaMetaSchema {
$id?: string;
$schema?: string;
$ref?: string;
title?: string;
description?: string;
default?: any;
examples?: any[];
multipleOf?: number;
maximum?: number;
exclusiveMaximum?: number;
minimum?: number;
exclusiveMinimum?: number;
maxLength?: number;
minLength?: number;
pattern?: string;
additionalItems?: JSONSchemaMetaSchema;
items?: JSONSchemaMetaSchema | JSONSchemaMetaSchema[];
maxItems?: number;
minItems?: number;
uniqueItems?: boolean;
contains?: JSONSchemaMetaSchema;
maxProperties?: number;
minProperties?: number;
required?: string[];
additionalProperties?: JSONSchemaMetaSchema;
definitions?: {
[k: string]: JSONSchemaMetaSchema;
};
properties?: {
[k: string]: JSONSchemaMetaSchema;
};
patternProperties?: {
[k: string]: JSONSchemaMetaSchema;
};
dependencies?: {
[k: string]: JSONSchemaMetaSchema | string[];
};
propertyNames?: JSONSchemaMetaSchema;
const?: any;
enum?: [any, ...any[]];
type?:
| ('array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string')
| ('array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string')[];
format?: string;
allOf?: JSONSchemaMetaSchema[];
anyOf?: JSONSchemaMetaSchema[];
oneOf?: JSONSchemaMetaSchema[];
not?: JSONSchemaMetaSchema;
[k: string]: any;
}
export interface RegionMap {
[k: string]: Region;
}
/**
* This interface was referenced by `RegionMap`'s JSON-Schema definition
* via the `patternProperty` "^.+$".
*/
export interface Region {
components?: ComponentArray;
[k: string]: any;
}
export interface Json {
[x: string]: string | number | boolean | Date | Json | JsonArray | null;
}
export interface JsonArray extends Array<string | number | boolean | Date | Json | JsonArray> {
export interface JsonArray extends Array<string | number | boolean | Date | Json | JsonArray> {}
export type AllDataTypes = Json | string | number | boolean | null | undefined;
export interface EditorOverride {
[key: string]: ViewMetadataSchema;
}
export declare type AllDataTypes = Json | string | number | boolean | null | undefined;
export interface DeclarativeType {
view?: ViewMetadataSchema;
schema: Json;
overrides?: EditorOverride;
}
export interface DeclarativeTypeMap {
[index: string]: DeclarativeType;
}
export interface Keyword {

@@ -15,5 +115,2 @@ name: string;

}
export interface ReferenceSchemaMap {
[index: string]: Json;
}
export declare type ValidationError = Error;

@@ -32,3 +129,3 @@ export interface ValidationResult {

export interface Validator {
validate(value?: AllDataTypes, referenceMap?: ReferenceSchemaMap): Promise<ValidationResult>;
validate(value?: AllDataTypes, referenceMap?: DeclarativeTypeMap): Promise<ValidationResult>;
getKeywords(keyword: string): Keyword[];

@@ -59,4 +156,5 @@ setExtensions(keywordExtensions?: ValidatorKeywordExtension[], formatExtensions?: ValidatorFormatExtension[]): void;

leafSchema: Json;
isExternal?: boolean;
}
export declare function getValidator(schema: Json, scope: string, initValue?: Json, referenceMap?: ReferenceSchemaMap): ValidatorResult | null;
export declare function getValidator(schema: Json, scope: string, initValue?: Json, referenceMap?: DeclarativeTypeMap): ValidatorResult | null;
export declare function getMin(schema?: Json): number | undefined;

@@ -63,0 +161,0 @@ export declare function getMax(schema?: Json): number | undefined;

@@ -5,3 +5,4 @@ {

"license": "MIT",
"version": "0.6.5",
"version": "0.6.6",
"type": "module",
"main": "dist/index.js",

@@ -27,2 +28,3 @@ "types": "dist/index.d.ts",

"dependencies": {
"@lcem/canonical-ui-metadata-schema": "0.6.6",
"ajv": "^6.12.2",

@@ -35,4 +37,5 @@ "ajv-errors": "^1.0.1"

"@rollup/plugin-node-resolve": "^7.1.1",
"@types/ajv-errors": "1.0.3"
"@types/ajv-errors": "1.0.3",
"fs-extra": "^10.0.0"
}
}

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc