diff --git a/ajv/ajv-tests.ts b/ajv/ajv-tests.ts
deleted file mode 100644
index 133a198db4..0000000000
--- a/ajv/ajv-tests.ts
+++ /dev/null
@@ -1,74 +0,0 @@
-///
-
-import * as Ajv from 'ajv';
-var ajv = new Ajv(); // options can be passed, e.g. {allErrors: true}
-var validate = ajv.compile({});
-var valid = validate({});
-if (!valid) console.log(validate.errors);
-
-var valid = ajv.validate({}, {});
-if (!valid) console.log(ajv.errors);
-
-ajv.addSchema({}, 'mySchema');
-var valid = ajv.validate('mySchema', {});
-if (!valid) console.log(ajv.errorsText());
-
-ajv.addKeyword('range', {
- type: 'number', compile: function (sch, parentSchema) {
- var min: any = sch[0];
- var max: any = sch[1];
-
- return parentSchema.exclusiveRange === true
- ? function (data) { return data > min && data < max; }
- : function (data) { return data >= min && data <= max; }
- }
-});
-
-var schema = { "range": [2, 4], "exclusiveRange": true };
-var validate = ajv.compile(schema);
-console.log(validate(2.01)); // true
-console.log(validate(3.99)); // true
-console.log(validate(2)); // false
-console.log(validate(4)); // false
-
-declare var request: any;
-function loadSchema(uri: any, callback: any) {
- request.json(uri, function (err: any, res: any, body: any) {
- if (err || res.statusCode >= 400)
- callback(err || new Error('Loading error: ' + res.statusCode));
- else
- callback(null, body);
- });
-}
-var ajv = new Ajv({ loadSchema: loadSchema });
-
-ajv.compileAsync(schema, function (err, validate) {
- if (err) return;
- var valid = validate({});
-});
-
-declare var knex: any;
-function checkIdExists(schema: any, data: any) {
- return knex(schema.table)
- .select('id')
- .where('id', data)
- .then(function (rows: any) {
- return true;
- });
-}
-
-var validate = ajv.compile(schema);
-
-(validate({ userId: 1, postId: 19 }) as PromiseLike)
- .then(function (valid) {
- // "valid" is always true here
- console.log('Data is valid');
- }, function (err) {
- if (!(err instanceof Ajv.ValidationError)) throw err;
- // data is invalid
- console.log('Validation errors:', err.errors);
- });
-
-var ajv = new Ajv({ /* async: 'es7', */ transpile: 'nodent' });
-var validate = ajv.compile(schema); // transpiled es7 async function
-(validate({}) as PromiseLike).then(() => { }, () => { });
diff --git a/ajv/index.d.ts b/ajv/index.d.ts
deleted file mode 100644
index 94d0055551..0000000000
--- a/ajv/index.d.ts
+++ /dev/null
@@ -1,114 +0,0 @@
-// Type definitions for ajv
-// Project: https://github.com/epoberezkin/ajv
-// Definitions by: York Yao
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-declare class Ajv {
- /**
- * Create Ajv instance.
- */
- constructor(options?: Ajv.AjvOptions);
- /**
- * Generate validating function and cache the compiled schema for future use.
- */
- compile(schema: any): Ajv.AjvValidate;
- /**
- * Asyncronous version of compile method that loads missing remote schemas using asynchronous function in options.loadSchema.
- */
- compileAsync(schema: any, callback: (error: Error, validate: Ajv.AjvValidate) => void): void;
- /**
- * Validate data using passed schema (it will be compiled and cached).
- */
- validate(schema: any, data: any): boolean | PromiseLike;
- errors: Ajv.ValidationError[];
- /**
- * Add schema(s) to validator instance.
- */
- addSchema(schema: any, key: string): void;
- /**
- * Adds meta schema(s) that can be used to validate other schemas.
- * That function should be used instead of addSchema because there may be instance options that would compile a meta schema incorrectly (at the moment it is removeAdditional option).
- */
- addMetaSchema(schema: any, key: string): void;
- /**
- * Validates schema.
- * This method should be used to validate schemas rather than validate due to the inconsistency of uri format in JSON-Schema standard.
- */
- validateSchema(schema: any): Boolean;
- /**
- * Retrieve compiled schema previously added with addSchema by the key passed to addSchema or by its full reference (id).
- * Returned validating function has schema property with the reference to the original schema.
- */
- getSchema(key: string): Ajv.AjvValidate;
- /**
- * Remove added/cached schema.
- * Even if schema is referenced by other schemas it can be safely removed as dependent schemas have local references.
- */
- removeSchema(schema: any): void;
- /**
- * Add custom format to validate strings. It can also be used to replace pre-defined formats for Ajv instance.
- */
- addFormat(name: string, format: any): void;
- /**
- * Add custom validation keyword to Ajv instance.
- */
- addKeyword(keyword: string, definition: Ajv.AjxKeywordDefinition): void;
- errorsText(): any;
- static ValidationError: Function;
-}
-declare namespace Ajv {
- type AjvOptions = {
- v5?: boolean;
- allErrors?: boolean;
- verbose?: boolean;
- jsonPointers?: boolean;
- uniqueItems?: boolean;
- unicode?: boolean;
- format?: string;
- formats?: any;
- unknownFormats?: true | string[] | "ignore";
- schemas?: any;
- missingRefs?: true | "ignore" | "fail";
- extendRefs?: true | "ignore" | "fail";
- loadSchema?(uri: string, callback: (error: Error, body: any) => void): void;
- removeAdditional?: boolean | "all" | "failing";
- useDefaults?: boolean | "shared";
- coerceTypes?: boolean | "array";
- async?: any;
- transpile?: string;
- meta?: boolean;
- validateSchema?: boolean | "log";
- addUsedSchema?: boolean;
- inlineRefs?: boolean | number;
- passContext?: boolean;
- loopRequired?: number;
- ownProperties?: boolean;
- multipleOfPrecision?: boolean | number;
- errorDataPath?: string,
- messages?: boolean;
- beautify?: boolean;
- cache?: any;
- }
- type AjvValidate = ((data: any) => boolean | PromiseLike) & {
- errors: ValidationError[];
- }
- type AjxKeywordDefinition = {
- async?: boolean;
- type: string;
- compile?: (schema: any, parentsSchema: any) => ((data: any) => boolean | PromiseLike);
- validate?: (schema: any, data: any) => boolean;
- }
- type ValidationError = {
- keyword: string;
- dataPath: string;
- schemaPath: string;
- params: any;
- message: string;
- schema: any;
- parentSchema: any;
- data: any;
- }
-}
-
-export = Ajv;
-
diff --git a/ajv/tsconfig.json b/ajv/tsconfig.json
deleted file mode 100644
index 01bf5ed1da..0000000000
--- a/ajv/tsconfig.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "compilerOptions": {
- "module": "commonjs",
- "target": "es6",
- "noImplicitAny": true,
- "strictNullChecks": false,
- "baseUrl": "../",
- "typeRoots": [
- "../"
- ],
- "types": [],
- "noEmit": true,
- "forceConsistentCasingInFileNames": true
- },
- "files": [
- "index.d.ts",
- "ajv-tests.ts"
- ]
-}
\ No newline at end of file
diff --git a/notNeededPackages.json b/notNeededPackages.json
index 472a3881ca..2566a6fac6 100644
--- a/notNeededPackages.json
+++ b/notNeededPackages.json
@@ -94,6 +94,12 @@
"typingsPackageName": "normalizr",
"sourceRepoURL": "https://github.com/paularmstrong/normalizr",
"asOfVersion": "2.0.18"
+ },
+ {
+ "libraryName": "ajv",
+ "typingsPackageName": "ajv",
+ "sourceRepoURL": "https://github.com/epoberezkin/ajv",
+ "asOfVersion": "1.0.0"
}
]
}