optolith-database-schema 0.13.2 → 0.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/lib/main.d.ts +5 -0
- package/lib/validation/raw.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.13.3](https://github.com/elyukai/optolith-database-schema/compare/v0.13.2...v0.13.3) (2023-11-01)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* ajv configuration options ([0c5ba39](https://github.com/elyukai/optolith-database-schema/commit/0c5ba3981e44edc120fcab237ecf8aa31af7a5ad))
|
|
11
|
+
|
|
5
12
|
### [0.13.2](https://github.com/elyukai/optolith-database-schema/compare/v0.13.1...v0.13.2) (2023-10-31)
|
|
6
13
|
|
|
7
14
|
### [0.13.1](https://github.com/elyukai/optolith-database-schema/compare/v0.13.0...v0.13.1) (2023-10-31)
|
package/lib/main.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Options as AjvOptions } from "ajv";
|
|
1
2
|
import { CacheMap } from "./config/cache.js";
|
|
2
3
|
import { TypeId, TypeMap } from "./config/types.js";
|
|
3
4
|
import "./helpers/array.js";
|
|
@@ -16,6 +17,10 @@ export type ValidationOptions = {
|
|
|
16
17
|
* @default false
|
|
17
18
|
*/
|
|
18
19
|
checkIntegrity?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Ajv instance options. See https://ajv.js.org/options.html.
|
|
22
|
+
*/
|
|
23
|
+
ajvOptions?: AjvOptions;
|
|
19
24
|
};
|
|
20
25
|
/**
|
|
21
26
|
* A type validation may fail because of the data not matching the schema, the
|
package/lib/validation/raw.js
CHANGED
|
@@ -31,8 +31,8 @@ const validateStructuralIntegrityOfFiles = (validator, typeConfig, validateFileN
|
|
|
31
31
|
}));
|
|
32
32
|
const validateSemanticAndReferencialIntegrityOfFiles = (validators, typeConfig, results) => results.map(mapSecond((res, path) => Result.reduce(res, ([id, data]) => Result.map(typeConfig.integrityValidator(validators, data, path), () => [id, data]), errors => Result.error(errors))));
|
|
33
33
|
export const getRawValidationResults = async (entityDirPaths, options = {}) => {
|
|
34
|
-
const { checkIntegrity = false } = options;
|
|
35
|
-
const validator = await getPreparedSchemaValidator(jsonSchemaSpec,
|
|
34
|
+
const { checkIntegrity = false, ajvOptions = {} } = options;
|
|
35
|
+
const validator = await getPreparedSchemaValidator(jsonSchemaSpec, ajvOptions, jsonSchemaDir);
|
|
36
36
|
const entityDirectoryPathEntries = Object.entries(entityDirPaths);
|
|
37
37
|
const structuralIntegrityResults = await Promise.all(entityDirectoryPathEntries.map(mapSecondAsync(async (path, typeName) => {
|
|
38
38
|
const files = await getFiles(path);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "optolith-database-schema",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.3",
|
|
4
4
|
"description": "Definitions and utilities for the flat-file database of Optolith, a character creation tool for the Pen and Paper RPG “The Dark Eye 5”, and its external integrations into other software.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tde",
|