39 Commits

Author SHA1 Message Date
raucao 85cfac2493 3.2.0 2025-01-20 12:44:19 -05:00
raucao b2b9d318cc Add amountSats to expense items 2025-01-20 12:44:04 -05:00
basti af4b4407b8 3.1.0 2022-04-27 15:50:16 +02:00
basti 7d2598efbd Update repo and homepage URLs (move to Gitea) 2022-04-27 15:49:55 +02:00
basti 2990b32029 Remove obsolete browserify transform dependency 2022-04-27 15:42:13 +02:00
basti 0566ba2f7f 3.0.0 2020-06-28 00:42:38 +02:00
basti a2dc2e15f2 Merge pull request #15 from 67P/feature/browser-compat
Use CommonJS exports/imports for schema files
2020-06-28 00:41:17 +02:00
basti 67cc3d9d74 Use CommonJS for schema files
Instead of relying on `fs` and `path`, which are node-specific modules.
2020-06-27 16:19:03 +02:00
basti bc039bbe5c 2.2.1 2020-05-16 13:18:56 +02:00
basti 0cb411c985 Merge pull request #12 from 67P/chore/move_to_org_repo
Move npm package to @kosmos namespace
2020-05-16 13:16:55 +02:00
basti d9e3b8fbb8 Add npm link/version to README 2020-05-16 13:11:50 +02:00
basti 3ea17ce47c Move package to @kosmos namespace 2020-05-16 13:05:43 +02:00
basti e850c0be4c Update README 2020-05-13 17:03:26 +02:00
basti f7a8e72d56 Add release-drafter config 2020-05-13 17:01:52 +02:00
basti e263406a0b 2.2.0 2020-05-13 17:00:02 +02:00
basti 85463cd9b1 Update author information
Make it less specific
2020-05-13 16:59:42 +02:00
basti a1fcea9bc9 Merge pull request #9 from 67P/feature/expenses
Initial expense schema
2020-05-13 16:58:21 +02:00
basti 9eba6cdec6 Merge pull request #10 from 67P/feature/categories
Add more contribution categories
2020-05-13 16:58:04 +02:00
basti 79426ca5e0 Moar kinds 2020-05-13 16:19:22 +02:00
basti 0678c3f4ea Add more contribution categories
Gotta do some testing and some business administration, too.

closes #7
2020-05-13 16:16:05 +02:00
basti 655e30227b Remove IDs 2020-05-13 16:13:39 +02:00
basti 300eb7f940 Allow additional props, add details prop 2020-05-13 16:13:12 +02:00
basti a41839ed09 Fix description 2020-05-06 11:59:36 +02:00
basti d7dfb3dfd4 Initial expense schema 2020-05-06 11:24:02 +02:00
bumi 98f5c3d1a6 Merge pull request #8 from 67P/skddc-patch-1
Update README - add link to json schema
2019-11-17 13:46:21 +00:00
basti 65f823b11c Update README
Add link to JSON Schema website
2019-11-17 14:43:05 +01:00
basti a073d4bb88 2.1.0 2019-05-10 13:12:32 +02:00
basti f1077ffe36 Add new "special" contribution kind
We agreed to use this for special contribution items like e.g. the
initial kredits balance for core contributors from before we tracked
everything.
2019-05-10 13:10:51 +02:00
bumi 074fd8aeae 2.0.0 2019-04-16 13:11:07 +02:00
bumi 824366c604 Merge pull request #5 from 67P/feature/contribution_date_time
Add date and time to contributions
2019-04-16 08:36:20 +00:00
basti 28a5e9f1fc Add date and time to contributions
Require date, but not time. Both in RFC 3339 format, as specified in
draft 07 of JSON Schema.
2019-04-10 18:30:46 +02:00
basti a2f7bda9e3 Fix typo 2018-06-19 17:48:07 +02:00
basti 6207e41d9f Update contributor info 2017-06-07 13:22:06 +02:00
basti 75b8b00497 1.1.2 2017-06-07 13:05:34 +02:00
basti 3b656d0ab9 Merge pull request #1 from 67P/fixes
Minor wording/typo fixes
2017-06-07 13:05:03 +02:00
galfert 831b36f61e Change wording of description 2017-06-07 12:28:28 +02:00
galfert e0ec67aad4 Fix property name 2017-06-07 12:27:32 +02:00
basti 72d0b00908 1.1.1 2017-06-05 22:09:55 +02:00
basti 060e29eccd Use correct dep key for brfs-babel
This would only work in dev, so fail on Travis.
2017-06-05 22:09:07 +02:00
9 changed files with 182 additions and 32 deletions
+4
View File
@@ -0,0 +1,4 @@
template: |
## Changes
$CHANGES
+4 -7
View File
@@ -1,5 +1,7 @@
This repository/module contains JSON Schema definitions as well as examples for
[Kosmos](https://kosmos.org) data formats.
[![npm](https://img.shields.io/npm/v/@kosmos/schemas)](https://www.npmjs.com/package/@kosmos/schemas)
This repository/module contains [JSON Schema](https://json-schema.org/)
definitions as well as examples for [Kosmos](https://kosmos.org) data formats.
## Usage
@@ -24,8 +26,3 @@ if (result) {
console.log(tv4.error);
}
```
## TODO
* Add script for publishing both human- and machine-readable schemas to
https://schemas.kosmos.org
+10
View File
@@ -0,0 +1,10 @@
{
"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"]
}
+6 -4
View File
@@ -1,7 +1,9 @@
const fs = require('fs');
const path = require('path');
const contribution = require('./schemas/contribution');
const contributor = require('./schemas/contributor');
const expense = require('./schemas/expense');
module.exports = {
"contribution": JSON.parse(fs.readFileSync(path.join(__dirname, 'schemas', 'contribution.json'))),
"contributor": JSON.parse(fs.readFileSync(path.join(__dirname, 'schemas', 'contributor.json')))
contribution,
contributor,
expense
};
+13
View File
@@ -0,0 +1,13 @@
{
"name": "@kosmos/schemas",
"version": "3.2.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@kosmos/schemas",
"version": "3.2.0",
"license": "MIT"
}
}
}
+7 -14
View File
@@ -1,29 +1,22 @@
{
"name": "kosmos-schemas",
"version": "1.1.0",
"name": "@kosmos/schemas",
"version": "3.2.0",
"description": "JSON-LD schemas for Kosmos data formats",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"kosmos",
"ipfs",
"kosmos",
"kredits",
"remotestorage"
],
"author": "Kosmos Contributors <mail@kosmos.org>",
"contributors": [],
"author": "Kosmos Contributors",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/67P/kosmos-schemas.git"
"url": "https://gitea.kosmos.org/kosmos/schemas.git"
},
"devDependencies": {
"brfs-babel": "^1.0.0"
},
"browserify": {
"transform": [
"brfs-babel"
]
}
"homepage": "https://gitea.kosmos.org/kosmos/schemas"
}
@@ -1,5 +1,5 @@
{
"$schema": "https://json-schema.org/draft-04/schema#",
module.exports = {
"$schema": "https://json-schema.org/draft-07/schema#",
"id": "https://schema.kosmos.org/Contribution",
"properties": {
"@context": {
@@ -14,7 +14,7 @@
},
"contributor": {
"properties": {
"uri": {
"ipfs": {
"type": "string",
"format": "uri",
"title": "IPFS URI",
@@ -26,16 +26,32 @@
],
"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": {
"type": "string",
"title": "Kind",
"description": "Type/category of contribution",
"enum": [
"bureaucracy",
"dev",
"design",
"ops",
"docs",
"community"
"community",
"special",
"qa",
"outreach"
]
},
"description": {
@@ -56,6 +72,7 @@
},
"required": [
"contributor",
"date",
"kind",
"description"
],
@@ -1,5 +1,5 @@
{
"$schema": "https://json-schema.org/draft-04/schema#",
module.exports = {
"$schema": "https://json-schema.org/draft-07/schema#",
"id": "https://schema.kosmos.org/Contributor",
"properties": {
"@context": {
@@ -15,7 +15,7 @@
"kind": {
"type": "string",
"title": "Kind",
"description": "Type/category of contribution",
"description": "Category of contributor",
"enum": [
"person",
"organization",
+114
View File
@@ -0,0 +1,114 @@
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": {}
}
}
}