diff --git a/package.json b/package.json index 0b59a09c5..b32f7dff9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@snapshot-labs/snapshot.js", - "version": "0.12.13", + "version": "0.12.14", "repository": "snapshot-labs/snapshot.js", "license": "MIT", "main": "dist/snapshot.cjs.js", diff --git a/src/schemas/space.json b/src/schemas/space.json index 542f0c339..489a2bf01 100644 --- a/src/schemas/space.json +++ b/src/schemas/space.json @@ -103,6 +103,10 @@ }, "domain": { "type": "string", + "allOf": [ + { "format": "hostname" }, + { "format": "lowercase" } + ], "title": "domain", "maxLength": 64 }, diff --git a/src/utils.ts b/src/utils.ts index a3115c826..d22352070 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -113,6 +113,10 @@ ajv.addFormat('long', { validate: () => true }); +ajv.addFormat('lowercase', { + validate: (value: string) => value === value.toLowerCase() +}); + ajv.addFormat('ethValue', { validate: (value: string) => { if (!value.match(/^([0-9]|[1-9][0-9]+)(\.[0-9]+)?$/)) return false; diff --git a/test/examples/space.json b/test/examples/space.json index cd62c3d8a..d262eb39f 100644 --- a/test/examples/space.json +++ b/test/examples/space.json @@ -16,6 +16,7 @@ "network": "1", "plugins": {}, "twitter": "lootproject", + "domain": "vote.lootproject.abc", "strategies": [ { "name": "erc721",