Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Decentralized Web Node (DWN) SDK

Code Coverage
![Statements](https://img.shields.io/badge/statements-93.99%25-brightgreen.svg?style=flat) ![Branches](https://img.shields.io/badge/branches-93.5%25-brightgreen.svg?style=flat) ![Functions](https://img.shields.io/badge/functions-91.72%25-brightgreen.svg?style=flat) ![Lines](https://img.shields.io/badge/lines-93.99%25-brightgreen.svg?style=flat)
![Statements](https://img.shields.io/badge/statements-93.99%25-brightgreen.svg?style=flat) ![Branches](https://img.shields.io/badge/branches-93.51%25-brightgreen.svg?style=flat) ![Functions](https://img.shields.io/badge/functions-91.72%25-brightgreen.svg?style=flat) ![Lines](https://img.shields.io/badge/lines-93.99%25-brightgreen.svg?style=flat)

## Introduction

Expand Down
1 change: 0 additions & 1 deletion build/compile-validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ const schemas = {
};

const ajv = new Ajv({ code: { source: true, esm: true } });
ajv.addFormat('date-time', /^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i);

for (const schemaName in schemas) {
ajv.addSchema(schemas[schemaName], schemaName);
Expand Down
6 changes: 5 additions & 1 deletion json-schemas/definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
"did": {
"type": "string",
"pattern": "^did:([a-z0-9]+):((?:(?:[a-zA-Z0-9._-]|(?:%[0-9a-fA-F]{2}))*:)*((?:[a-zA-Z0-9._-]|(?:%[0-9a-fA-F]{2}))+))((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(\/[^#?]*)?([?][^#]*)?(#.*)?$"
},
"date-time": {
"type": "string",
"pattern": "^[0-9]{4}-[0-1]\\d-[0-3]\\dT([0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)\\.[0-9]{6}Z$"
}
}
}
}
3 changes: 1 addition & 2 deletions json-schemas/hooks/hooks-write.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
"type": "string"
},
"dateCreated": {
"type": "string",
"format": "date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
},
"schema": {
"type": "string"
Expand Down
9 changes: 3 additions & 6 deletions json-schemas/records/records-query.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
"type": "string"
},
"dateCreated": {
"type": "string",
"format": "date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
},
"filter": {
"type": "object",
Expand Down Expand Up @@ -72,12 +71,10 @@
"additionalProperties": false,
"properties": {
"from": {
"type": "string",
"format": "date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
},
"to": {
"type": "string",
"format": "date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
}
}
}
Expand Down
9 changes: 3 additions & 6 deletions json-schemas/records/records-write.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,16 @@
"type": "number"
},
"dateCreated": {
"type": "string",
"format": "date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
},
"dateModified": {
"type": "string",
"format": "date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
},
"published": {
"type": "boolean"
},
"datePublished": {
"type": "string",
"format": "date-time"
"$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/date-time"
},
"dataFormat": {
"type": "string"
Expand Down