Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e263406a0b | |||
| 85463cd9b1 | |||
| a1fcea9bc9 | |||
| 9eba6cdec6 | |||
| 79426ca5e0 | |||
| 0678c3f4ea | |||
| 655e30227b | |||
| 300eb7f940 | |||
| a41839ed09 | |||
| d7dfb3dfd4 | |||
| 98f5c3d1a6 | |||
| 65f823b11c | |||
| a073d4bb88 | |||
| f1077ffe36 | |||
| 074fd8aeae | |||
| 824366c604 | |||
| 28a5e9f1fc | |||
| a2f7bda9e3 | |||
| 6207e41d9f | |||
| 75b8b00497 | |||
| 3b656d0ab9 | |||
| 831b36f61e | |||
| e0ec67aad4 |
@@ -1,4 +1,4 @@
|
|||||||
This repository/module contains JSON Schema definitions as well as examples for
|
This repository/module contains [JSON Schema](https://json-schema.org/) definitions as well as examples for
|
||||||
[Kosmos](https://kosmos.org) data formats.
|
[Kosmos](https://kosmos.org) data formats.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
@@ -28,4 +28,4 @@ if (result) {
|
|||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
* Add script for publishing both human- and machine-readable schemas to
|
* Add script for publishing both human- and machine-readable schemas to
|
||||||
https://schemas.kosmos.org
|
https://schema.kosmos.org
|
||||||
|
|||||||
9
examples/expense.json
Normal file
9
examples/expense.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"title": "Server rent",
|
||||||
|
"description": "Dedicated server: andromeda.kosmos.org, April 2020",
|
||||||
|
"currency": "EUR",
|
||||||
|
"amount": 39.00,
|
||||||
|
"date": "2020-05-06",
|
||||||
|
"url": "https://wiki.kosmos.org/Infrastructure#Hetzner",
|
||||||
|
"tags": ["infrastructure", "server", "hetzner"]
|
||||||
|
}
|
||||||
@@ -1,18 +1,17 @@
|
|||||||
{
|
{
|
||||||
"name": "kosmos-schemas",
|
"name": "kosmos-schemas",
|
||||||
"version": "1.1.1",
|
"version": "2.2.0",
|
||||||
"description": "JSON-LD schemas for Kosmos data formats",
|
"description": "JSON-LD schemas for Kosmos data formats",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"kosmos",
|
|
||||||
"ipfs",
|
"ipfs",
|
||||||
|
"kosmos",
|
||||||
"remotestorage"
|
"remotestorage"
|
||||||
],
|
],
|
||||||
"author": "Kosmos Contributors <mail@kosmos.org>",
|
"author": "Kosmos Contributors",
|
||||||
"contributors": [],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://json-schema.org/draft-04/schema#",
|
"$schema": "https://json-schema.org/draft-07/schema#",
|
||||||
"id": "https://schema.kosmos.org/Contribution",
|
"id": "https://schema.kosmos.org/Contribution",
|
||||||
"properties": {
|
"properties": {
|
||||||
"@context": {
|
"@context": {
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
},
|
},
|
||||||
"contributor": {
|
"contributor": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"uri": {
|
"ipfs": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "uri",
|
"format": "uri",
|
||||||
"title": "IPFS URI",
|
"title": "IPFS URI",
|
||||||
@@ -26,16 +26,32 @@
|
|||||||
],
|
],
|
||||||
"type": "object"
|
"type": "object"
|
||||||
},
|
},
|
||||||
|
"date": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "date",
|
||||||
|
"title": "Date",
|
||||||
|
"description": "Date of contribution (RFC 3339 full-date)"
|
||||||
|
},
|
||||||
|
"time": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "time",
|
||||||
|
"title": "Time",
|
||||||
|
"description": "Time of contribution (RFC 3339 full-time)"
|
||||||
|
},
|
||||||
"kind": {
|
"kind": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"title": "Kind",
|
"title": "Kind",
|
||||||
"description": "Type/category of contribution",
|
"description": "Type/category of contribution",
|
||||||
"enum": [
|
"enum": [
|
||||||
|
"bureaucracy",
|
||||||
"dev",
|
"dev",
|
||||||
"design",
|
"design",
|
||||||
"ops",
|
"ops",
|
||||||
"docs",
|
"docs",
|
||||||
"community"
|
"community",
|
||||||
|
"special",
|
||||||
|
"qa",
|
||||||
|
"outreach"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"description": {
|
"description": {
|
||||||
@@ -56,6 +72,7 @@
|
|||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"contributor",
|
"contributor",
|
||||||
|
"date",
|
||||||
"kind",
|
"kind",
|
||||||
"description"
|
"description"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://json-schema.org/draft-04/schema#",
|
"$schema": "https://json-schema.org/draft-07/schema#",
|
||||||
"id": "https://schema.kosmos.org/Contributor",
|
"id": "https://schema.kosmos.org/Contributor",
|
||||||
"properties": {
|
"properties": {
|
||||||
"@context": {
|
"@context": {
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
"kind": {
|
"kind": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"title": "Kind",
|
"title": "Kind",
|
||||||
"description": "Type/category of contribution",
|
"description": "Category of contributor",
|
||||||
"enum": [
|
"enum": [
|
||||||
"person",
|
"person",
|
||||||
"organization",
|
"organization",
|
||||||
|
|||||||
105
schemas/expense.json
Normal file
105
schemas/expense.json
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
{
|
||||||
|
"$schema": "http://json-schema.org/draft-07/schema",
|
||||||
|
"$id": "https://schema.kosmos.org/Expense",
|
||||||
|
"type": "object",
|
||||||
|
"title": "Expense",
|
||||||
|
"description": "Record of costs expended",
|
||||||
|
"default": {},
|
||||||
|
"required": [
|
||||||
|
"title",
|
||||||
|
"currency",
|
||||||
|
"amount"
|
||||||
|
],
|
||||||
|
"additionalProperties": true,
|
||||||
|
"properties": {
|
||||||
|
"@context": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [ "https://schema.kosmos.org" ],
|
||||||
|
"default": "https://schema.kosmos.org"
|
||||||
|
},
|
||||||
|
"@type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [ "Expense" ],
|
||||||
|
"default": "Expense"
|
||||||
|
},
|
||||||
|
"title": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "Title",
|
||||||
|
"description": "A short description of the expense",
|
||||||
|
"default": "",
|
||||||
|
"examples": [
|
||||||
|
"Server rent"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "Description",
|
||||||
|
"description": "A longer description of the expense",
|
||||||
|
"default": "",
|
||||||
|
"examples": [
|
||||||
|
"Dedicated server: andromeda.kosmos.org"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"currency": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "Currency",
|
||||||
|
"description": "ISO 4217 (or other) code of the currency that the expense was paid with",
|
||||||
|
"default": "",
|
||||||
|
"examples": [
|
||||||
|
"EUR",
|
||||||
|
"USD",
|
||||||
|
"BTC"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"amount": {
|
||||||
|
"type": "number",
|
||||||
|
"title": "Amount",
|
||||||
|
"description": "Expended amount of defined currency",
|
||||||
|
"default": 0,
|
||||||
|
"examples": [
|
||||||
|
42.0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"date": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "date",
|
||||||
|
"title": "Date",
|
||||||
|
"description": "Date when expense was logged/proposed (RFC 3339 full-date)"
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "uri",
|
||||||
|
"title": "URL",
|
||||||
|
"description": "A URL pointing to more information about the expense or related items",
|
||||||
|
"default": "",
|
||||||
|
"examples": [
|
||||||
|
"https://wiki.kosmos.org/Infrastructure#Hetzner"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"tags": {
|
||||||
|
"type": "array",
|
||||||
|
"title": "Tags",
|
||||||
|
"description": "Tags for organizing, filtering, sorting, etc.",
|
||||||
|
"default": [],
|
||||||
|
"items": {
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"title": "Tag",
|
||||||
|
"description": "A tag (lowercase dasherized)",
|
||||||
|
"default": "",
|
||||||
|
"examples": [
|
||||||
|
"infrastructure",
|
||||||
|
"server"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"details": {
|
||||||
|
"type": "object",
|
||||||
|
"title": "Tag",
|
||||||
|
"properties": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user