32 Commits

Author SHA1 Message Date
0566ba2f7f 3.0.0 2020-06-28 00:42:38 +02:00
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
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
bc039bbe5c 2.2.1 2020-05-16 13:18:56 +02:00
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
d9e3b8fbb8 Add npm link/version to README 2020-05-16 13:11:50 +02:00
3ea17ce47c Move package to @kosmos namespace 2020-05-16 13:05:43 +02:00
e850c0be4c Update README 2020-05-13 17:03:26 +02:00
f7a8e72d56 Add release-drafter config 2020-05-13 17:01:52 +02:00
e263406a0b 2.2.0 2020-05-13 17:00:02 +02:00
85463cd9b1 Update author information
Make it less specific
2020-05-13 16:59:42 +02:00
a1fcea9bc9 Merge pull request #9 from 67P/feature/expenses
Initial expense schema
2020-05-13 16:58:21 +02:00
9eba6cdec6 Merge pull request #10 from 67P/feature/categories
Add more contribution categories
2020-05-13 16:58:04 +02:00
79426ca5e0 Moar kinds 2020-05-13 16:19:22 +02:00
0678c3f4ea Add more contribution categories
Gotta do some testing and some business administration, too.

closes #7
2020-05-13 16:16:05 +02:00
655e30227b Remove IDs 2020-05-13 16:13:39 +02:00
300eb7f940 Allow additional props, add details prop 2020-05-13 16:13:12 +02:00
a41839ed09 Fix description 2020-05-06 11:59:36 +02:00
d7dfb3dfd4 Initial expense schema 2020-05-06 11:24:02 +02:00
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
65f823b11c Update README
Add link to JSON Schema website
2019-11-17 14:43:05 +01:00
a073d4bb88 2.1.0 2019-05-10 13:12:32 +02:00
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
074fd8aeae 2.0.0 2019-04-16 13:11:07 +02:00
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
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
a2f7bda9e3 Fix typo 2018-06-19 17:48:07 +02:00
6207e41d9f Update contributor info 2017-06-07 13:22:06 +02:00
75b8b00497 1.1.2 2017-06-07 13:05:34 +02:00
3b656d0ab9 Merge pull request #1 from 67P/fixes
Minor wording/typo fixes
2017-06-07 13:05:03 +02:00
831b36f61e Change wording of description 2017-06-07 12:28:28 +02:00
e0ec67aad4 Fix property name 2017-06-07 12:27:32 +02:00
9 changed files with 665 additions and 23 deletions

4
.github/release-drafter.yml vendored Normal file
View File

@@ -0,0 +1,4 @@
template: |
## Changes
$CHANGES

View File

@@ -1,5 +1,7 @@
This repository/module contains JSON Schema definitions as well as examples for [![npm](https://img.shields.io/npm/v/@kosmos/schemas)](https://www.npmjs.com/package/@kosmos/schemas)
[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
@@ -24,8 +26,3 @@ 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

9
examples/expense.json Normal file
View 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"]
}

View File

@@ -1,7 +1,9 @@
const fs = require('fs'); const contribution = require('./schemas/contribution');
const path = require('path'); const contributor = require('./schemas/contributor');
const expense = require('./schemas/expense');
module.exports = { module.exports = {
"contribution": JSON.parse(fs.readFileSync(path.join(__dirname, 'schemas', 'contribution.json'))), contribution,
"contributor": JSON.parse(fs.readFileSync(path.join(__dirname, 'schemas', 'contributor.json'))) contributor,
expense
}; };

509
package-lock.json generated Normal file
View File

@@ -0,0 +1,509 @@
{
"name": "@kosmos/schemas",
"version": "3.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"ansi-regex": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
},
"ansi-styles": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
"integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4="
},
"babel-code-frame": {
"version": "6.22.0",
"resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.22.0.tgz",
"integrity": "sha1-AnYgvuVnqIwyVhV05/0IAdMxGOQ=",
"requires": {
"chalk": "^1.1.0",
"esutils": "^2.0.2",
"js-tokens": "^3.0.0"
},
"dependencies": {
"esutils": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz",
"integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs="
}
}
},
"babel-core": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.24.1.tgz",
"integrity": "sha1-jEKFZNzh4fQfszfsNPTDsCK1rYM=",
"requires": {
"babel-code-frame": "^6.22.0",
"babel-generator": "^6.24.1",
"babel-helpers": "^6.24.1",
"babel-messages": "^6.23.0",
"babel-register": "^6.24.1",
"babel-runtime": "^6.22.0",
"babel-template": "^6.24.1",
"babel-traverse": "^6.24.1",
"babel-types": "^6.24.1",
"babylon": "^6.11.0",
"convert-source-map": "^1.1.0",
"debug": "^2.1.1",
"json5": "^0.5.0",
"lodash": "^4.2.0",
"minimatch": "^3.0.2",
"path-is-absolute": "^1.0.0",
"private": "^0.1.6",
"slash": "^1.0.0",
"source-map": "^0.5.0"
},
"dependencies": {
"source-map": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz",
"integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI="
}
}
},
"babel-generator": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.24.1.tgz",
"integrity": "sha1-5xX0hsWN7SVknYiJRNUqoHxdlJc=",
"requires": {
"babel-messages": "^6.23.0",
"babel-runtime": "^6.22.0",
"babel-types": "^6.24.1",
"detect-indent": "^4.0.0",
"jsesc": "^1.3.0",
"lodash": "^4.2.0",
"source-map": "^0.5.0",
"trim-right": "^1.0.1"
},
"dependencies": {
"source-map": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz",
"integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI="
}
}
},
"babel-helpers": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz",
"integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=",
"requires": {
"babel-runtime": "^6.22.0",
"babel-template": "^6.24.1"
}
},
"babel-messages": {
"version": "6.23.0",
"resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz",
"integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=",
"requires": {
"babel-runtime": "^6.22.0"
}
},
"babel-plugin-static-fs": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/babel-plugin-static-fs/-/babel-plugin-static-fs-1.1.0.tgz",
"integrity": "sha1-gSrtwGKX6QvquO0C8qaazcyiPAU=",
"requires": {
"babel-template": "^6.3.13",
"babel-types": "^6.4.1",
"events": "^1.1.0"
}
},
"babel-register": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.24.1.tgz",
"integrity": "sha1-fhDhOi9xBlvfrVoXh7pFvKbe118=",
"requires": {
"babel-core": "^6.24.1",
"babel-runtime": "^6.22.0",
"core-js": "^2.4.0",
"home-or-tmp": "^2.0.0",
"lodash": "^4.2.0",
"mkdirp": "^0.5.1",
"source-map-support": "^0.4.2"
}
},
"babel-runtime": {
"version": "6.23.0",
"resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz",
"integrity": "sha1-CpSJ8UTecO+zzkMArM2zKeL8VDs=",
"requires": {
"core-js": "^2.4.0",
"regenerator-runtime": "^0.10.0"
}
},
"babel-template": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.24.1.tgz",
"integrity": "sha1-BK5RTx+Ts6JTfyoPYKWkX7gwgzM=",
"requires": {
"babel-runtime": "^6.22.0",
"babel-traverse": "^6.24.1",
"babel-types": "^6.24.1",
"babylon": "^6.11.0",
"lodash": "^4.2.0"
}
},
"babel-traverse": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.24.1.tgz",
"integrity": "sha1-qzZnP9NW+aCUhlnnszjV/q2zFpU=",
"requires": {
"babel-code-frame": "^6.22.0",
"babel-messages": "^6.23.0",
"babel-runtime": "^6.22.0",
"babel-types": "^6.24.1",
"babylon": "^6.15.0",
"debug": "^2.2.0",
"globals": "^9.0.0",
"invariant": "^2.2.0",
"lodash": "^4.2.0"
}
},
"babel-types": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.24.1.tgz",
"integrity": "sha1-oTaHncFbNga9oNkMH8dDBML/CXU=",
"requires": {
"babel-runtime": "^6.22.0",
"esutils": "^2.0.2",
"lodash": "^4.2.0",
"to-fast-properties": "^1.0.1"
},
"dependencies": {
"esutils": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz",
"integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs="
}
}
},
"babylon": {
"version": "6.17.2",
"resolved": "https://registry.npmjs.org/babylon/-/babylon-6.17.2.tgz",
"integrity": "sha1-IB0l71+JLEG65JSIsI2w3Udun1w="
},
"balanced-match": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz",
"integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg="
},
"brace-expansion": {
"version": "1.1.7",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.7.tgz",
"integrity": "sha1-Pv/DxQ4ABTH7cg6v+A8K6O8jz1k=",
"requires": {
"balanced-match": "^0.4.1",
"concat-map": "0.0.1"
}
},
"brfs-babel": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/brfs-babel/-/brfs-babel-1.0.0.tgz",
"integrity": "sha1-Zy32AGfQKSEMSTKNeLOXnVe1Cxg=",
"requires": {
"babel-core": "^6.4.0",
"babel-plugin-static-fs": "^1.1.0",
"through2": "^2.0.0"
}
},
"chalk": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
"requires": {
"ansi-styles": "^2.2.1",
"escape-string-regexp": "^1.0.2",
"has-ansi": "^2.0.0",
"strip-ansi": "^3.0.0",
"supports-color": "^2.0.0"
}
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
},
"convert-source-map": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.0.tgz",
"integrity": "sha1-ms1whRxtXf3ZPZKC5e35SgP/RrU="
},
"core-js": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.4.1.tgz",
"integrity": "sha1-TekR5mew6ukSTjQlS1OupvxhjT4="
},
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
},
"debug": {
"version": "2.6.8",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz",
"integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=",
"requires": {
"ms": "2.0.0"
}
},
"detect-indent": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz",
"integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=",
"requires": {
"repeating": "^2.0.0"
}
},
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
},
"events": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz",
"integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ="
},
"globals": {
"version": "9.17.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-9.17.0.tgz",
"integrity": "sha1-DAymltm5u2lNLlRwvTd3fKrVAoY="
},
"has-ansi": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
"integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=",
"requires": {
"ansi-regex": "^2.0.0"
}
},
"home-or-tmp": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz",
"integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=",
"requires": {
"os-homedir": "^1.0.0",
"os-tmpdir": "^1.0.1"
}
},
"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
},
"invariant": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz",
"integrity": "sha1-nh9WrArNtr8wMwbzOL47IErmA2A=",
"requires": {
"loose-envify": "^1.0.0"
}
},
"is-finite": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz",
"integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=",
"requires": {
"number-is-nan": "^1.0.0"
}
},
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
},
"js-tokens": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.1.tgz",
"integrity": "sha1-COnxMkhKLEWjCQfp3E1VZ7fxFNc="
},
"jsesc": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz",
"integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s="
},
"json5": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz",
"integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE="
},
"lodash": {
"version": "4.17.4",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz",
"integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4="
},
"loose-envify": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz",
"integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=",
"requires": {
"js-tokens": "^3.0.0"
}
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=",
"requires": {
"brace-expansion": "^1.1.7"
}
},
"mkdirp": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"requires": {
"minimist": "0.0.8"
},
"dependencies": {
"minimist": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0="
}
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
},
"number-is-nan": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0="
},
"os-homedir": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M="
},
"os-tmpdir": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ="
},
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
},
"private": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz",
"integrity": "sha1-aM5eih7woju1cMwoU3tTMqumPvE="
},
"process-nextick-args": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz",
"integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M="
},
"readable-stream": {
"version": "2.2.10",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.10.tgz",
"integrity": "sha1-7/5yu3yITA3TNeI3nVJhltnQEe4=",
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.1",
"isarray": "~1.0.0",
"process-nextick-args": "~1.0.6",
"safe-buffer": "^5.0.1",
"string_decoder": "~1.0.0",
"util-deprecate": "~1.0.1"
}
},
"regenerator-runtime": {
"version": "0.10.5",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz",
"integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg="
},
"repeating": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz",
"integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=",
"requires": {
"is-finite": "^1.0.0"
}
},
"safe-buffer": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.0.tgz",
"integrity": "sha1-/kyEYDl/nqqqWOc75GJzQIpF4iM="
},
"slash": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz",
"integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU="
},
"source-map-support": {
"version": "0.4.15",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.15.tgz",
"integrity": "sha1-AyAt9lwG0r2MfsI2KhkwVv7407E=",
"requires": {
"source-map": "^0.5.6"
},
"dependencies": {
"source-map": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz",
"integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI="
}
}
},
"string_decoder": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.1.tgz",
"integrity": "sha1-YuIA8DmVWmgQ2N8KM//A8BNmLZg=",
"requires": {
"safe-buffer": "^5.0.1"
}
},
"strip-ansi": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"requires": {
"ansi-regex": "^2.0.0"
}
},
"supports-color": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc="
},
"through2": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz",
"integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=",
"requires": {
"readable-stream": "^2.1.5",
"xtend": "~4.0.1"
}
},
"to-fast-properties": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz",
"integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc="
},
"trim-right": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz",
"integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM="
},
"util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
},
"xtend": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
"integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68="
}
}
}

View File

@@ -1,18 +1,17 @@
{ {
"name": "kosmos-schemas", "name": "@kosmos/schemas",
"version": "1.1.1", "version": "3.0.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",

View File

@@ -1,5 +1,5 @@
{ module.exports = {
"$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"
], ],

View File

@@ -1,5 +1,5 @@
{ module.exports = {
"$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.js Normal file
View File

@@ -0,0 +1,105 @@
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
]
},
"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": {}
}
}
}