Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions build/compile-validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
* - to reduce the browser bundle size - Ajv is not included in the bundle
* - to reduce the start-up time - the validation and compilation of schemas will happen during build time.
*/
import addFormats from 'ajv-formats';

import fs from 'node:fs';
import path from 'node:path';
import url from 'node:url';

import Ajv from 'ajv';

import mkdirp from 'mkdirp';
import standaloneCode from 'ajv/dist/standalone/index.js';

Expand Down Expand Up @@ -60,6 +62,7 @@ const schemas = {
};

const ajv = new Ajv({ code: { source: true, esm: true } });
addFormats(ajv);

for (const schemaName in schemas) {
ajv.addSchema(schemas[schemaName], schemaName);
Expand Down
3 changes: 2 additions & 1 deletion json-schemas/hooks/hooks-write.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"type": "string"
},
"dateCreated": {
"type": "string"
"type": "string",
"format": "date-time"
},
"schema": {
"type": "string"
Expand Down
9 changes: 6 additions & 3 deletions json-schemas/records/records-query.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"type": "string"
},
"dateCreated": {
"type": "string"
"type": "string",
"format": "date-time"
},
"filter": {
"type": "object",
Expand Down Expand Up @@ -71,10 +72,12 @@
"additionalProperties": false,
"properties": {
"from": {
"type": "string"
"type": "string",
"format": "date-time"
},
"to": {
"type": "string"
"type": "string",
"format": "date-time"
}
}
}
Expand Down
9 changes: 6 additions & 3 deletions json-schemas/records/records-write.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,19 @@
"type": "number"
},
"dateCreated": {
"type": "string"
"type": "string",
"format": "date-time"
},
"dateModified": {
"type": "string"
"type": "string",
"format": "date-time"
},
"published": {
"type": "boolean"
},
"datePublished": {
"type": "string"
"type": "string",
"format": "date-time"
},
"dataFormat": {
"type": "string"
Expand Down
39 changes: 32 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
"@types/readable-stream": "2.3.15",
"@types/secp256k1": "4.0.3",
"abstract-level": "1.0.3",
"ajv": "8.11.0",
"ajv": "8.12.0",
"ajv-formats": "^3.0.0-rc.0",
"blockstore-core": "3.0.0",
"cross-fetch": "3.1.5",
"date-fns": "2.28.0",
Expand Down