Compare commits
No commits in common. "master" and "v1.1.2" have entirely different histories.
4
.github/release-drafter.yml
vendored
4
.github/release-drafter.yml
vendored
@ -1,4 +0,0 @@
|
|||||||
template: |
|
|
||||||
## Changes
|
|
||||||
|
|
||||||
$CHANGES
|
|
11
README.md
11
README.md
@ -1,7 +1,5 @@
|
|||||||
[](https://www.npmjs.com/package/@kosmos/schemas)
|
This repository/module contains JSON Schema definitions as well as examples for
|
||||||
|
[Kosmos](https://kosmos.org) data formats.
|
||||||
This repository/module contains [JSON Schema](https://json-schema.org/)
|
|
||||||
definitions as well as examples for [Kosmos](https://kosmos.org) data formats.
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@ -26,3 +24,8 @@ if (result) {
|
|||||||
console.log(tv4.error);
|
console.log(tv4.error);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## TODO
|
||||||
|
|
||||||
|
* Add script for publishing both human- and machine-readable schemas to
|
||||||
|
https://schemas.kosmos.org
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "Server rent",
|
|
||||||
"description": "Dedicated server: andromeda.kosmos.org, April 2020",
|
|
||||||
"currency": "EUR",
|
|
||||||
"amount": 39.00,
|
|
||||||
"amountSats": 422966,
|
|
||||||
"date": "2020-05-06",
|
|
||||||
"url": "https://wiki.kosmos.org/Infrastructure#Hetzner",
|
|
||||||
"tags": ["infrastructure", "server", "hetzner"]
|
|
||||||
}
|
|
10
index.js
10
index.js
@ -1,9 +1,7 @@
|
|||||||
const contribution = require('./schemas/contribution');
|
const fs = require('fs');
|
||||||
const contributor = require('./schemas/contributor');
|
const path = require('path');
|
||||||
const expense = require('./schemas/expense');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
contribution,
|
"contribution": JSON.parse(fs.readFileSync(path.join(__dirname, 'schemas', 'contribution.json'))),
|
||||||
contributor,
|
"contributor": JSON.parse(fs.readFileSync(path.join(__dirname, 'schemas', 'contributor.json')))
|
||||||
expense
|
|
||||||
};
|
};
|
||||||
|
13
package-lock.json
generated
13
package-lock.json
generated
@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@kosmos/schemas",
|
|
||||||
"version": "3.2.0",
|
|
||||||
"lockfileVersion": 2,
|
|
||||||
"requires": true,
|
|
||||||
"packages": {
|
|
||||||
"": {
|
|
||||||
"name": "@kosmos/schemas",
|
|
||||||
"version": "3.2.0",
|
|
||||||
"license": "MIT"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
21
package.json
21
package.json
@ -1,22 +1,29 @@
|
|||||||
{
|
{
|
||||||
"name": "@kosmos/schemas",
|
"name": "kosmos-schemas",
|
||||||
"version": "3.2.0",
|
"version": "1.1.2",
|
||||||
"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": [
|
||||||
"ipfs",
|
|
||||||
"kosmos",
|
"kosmos",
|
||||||
"kredits",
|
"ipfs",
|
||||||
"remotestorage"
|
"remotestorage"
|
||||||
],
|
],
|
||||||
"author": "Kosmos Contributors",
|
"author": "Kosmos Contributors <mail@kosmos.org>",
|
||||||
|
"contributors": [],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://gitea.kosmos.org/kosmos/schemas.git"
|
"url": "https://github.com/67P/kosmos-schemas.git"
|
||||||
},
|
},
|
||||||
"homepage": "https://gitea.kosmos.org/kosmos/schemas"
|
"dependencies": {
|
||||||
|
"brfs-babel": "^1.0.0"
|
||||||
|
},
|
||||||
|
"browserify": {
|
||||||
|
"transform": [
|
||||||
|
"brfs-babel"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
module.exports = {
|
{
|
||||||
"$schema": "https://json-schema.org/draft-07/schema#",
|
"$schema": "https://json-schema.org/draft-04/schema#",
|
||||||
"id": "https://schema.kosmos.org/Contribution",
|
"id": "https://schema.kosmos.org/Contribution",
|
||||||
"properties": {
|
"properties": {
|
||||||
"@context": {
|
"@context": {
|
||||||
@ -26,32 +26,16 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
"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": {
|
||||||
@ -72,7 +56,6 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"contributor",
|
"contributor",
|
||||||
"date",
|
|
||||||
"kind",
|
"kind",
|
||||||
"description"
|
"description"
|
||||||
],
|
],
|
@ -1,5 +1,5 @@
|
|||||||
module.exports = {
|
{
|
||||||
"$schema": "https://json-schema.org/draft-07/schema#",
|
"$schema": "https://json-schema.org/draft-04/schema#",
|
||||||
"id": "https://schema.kosmos.org/Contributor",
|
"id": "https://schema.kosmos.org/Contributor",
|
||||||
"properties": {
|
"properties": {
|
||||||
"@context": {
|
"@context": {
|
@ -1,114 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
"$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
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"amountSats": {
|
|
||||||
"type": "number",
|
|
||||||
"title": "Amount in sats",
|
|
||||||
"description": "Amount in BTC satoshis",
|
|
||||||
"default": 0,
|
|
||||||
"examples": [
|
|
||||||
21000
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"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": {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user