diff --git a/draft-01/directoryFile.schema.json b/draft-01/directoryFile.schema.json new file mode 100644 index 0000000..614633f --- /dev/null +++ b/draft-01/directoryFile.schema.json @@ -0,0 +1,53 @@ +{ + "$id": "https://skystandards.hns.siasky.net/draft-01/directoryFile.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "description": "Metadata of a file, can contain multiple versions", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of this file" + }, + "created": { + "type": "integer", + "description": "Unix timestamp (in milliseconds) when this file was created", + "minimum": 0 + }, + "modified": { + "type": "integer", + "description": "Unix timestamp (in milliseconds) when this file was last modified", + "minimum": 0 + }, + "mimeType": { + "type": "string", + "description": "MIME Type of the file, optional" + }, + "version": { + "type": "integer", + "description": "Current version of the file. When this file was already modified 9 times, this value is 9", + "minimum": 0 + }, + "file": { + "$ref": "https://skystandards.hns.siasky.net/draft-01/fileData.schema.json", + "description": "The current version of a file" + }, + "history": { + "type": "object", + "patternProperties": { + "^[0-9]+$": { + "$ref": "https://skystandards.hns.siasky.net/draft-01/fileData.schema.json", + "description": "A file version" + } + }, + "description": "Historic versions of a file", + "additionalProperties": false + } + }, + "required": [ + "name", + "created", + "modified", + "version", + "file" + ] +} \ No newline at end of file diff --git a/draft-01/directoryIndex.schema.json b/draft-01/directoryIndex.schema.json new file mode 100644 index 0000000..c3b320f --- /dev/null +++ b/draft-01/directoryIndex.schema.json @@ -0,0 +1,43 @@ +{ + "$id": "https://skystandards.hns.siasky.net/draft-01/directoryIndex.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "description": "Index file of a directory, contains all directories and files in this specific directory", + "type": "object", + "properties": { + "directories": { + "type": "object", + "patternProperties": { + "^.+$": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of this directory" + }, + "created": { + "type": "integer", + "description": "Unix timestamp (in milliseconds) when this directory was created", + "minimum": 0 + } + } + } + }, + "additionalProperties": false, + "description": "A subdirectory in this directory" + }, + "files": { + "type": "object", + "patternProperties": { + "^.+$": { + "$ref": "https://skystandards.hns.siasky.net/draft-01/directoryFile.schema.json" + } + }, + "additionalProperties": false, + "description": "A file in this directory" + } + }, + "required": [ + "directories", + "files" + ] +} \ No newline at end of file diff --git a/draft-01/fileData.schema.json b/draft-01/fileData.schema.json new file mode 100644 index 0000000..5bb6dce --- /dev/null +++ b/draft-01/fileData.schema.json @@ -0,0 +1,54 @@ +{ + "$id": "https://skystandards.hns.siasky.net/draft-01/fileData.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "description": "Specific version of a file. Immutable.", + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "URL where the encrypted file blob can be downloaded, usually a skylink (sia://)" + }, + "key": { + "type": "string", + "description": "The secret key used to encrypt this file, base64Url-encoded" + }, + "encryptionType": { + "type": "string", + "description": "Which algorithm is used to encrypt and decrypt this file", + "examples": [ + "AEAD_XCHACHA20_POLY1305" + ] + }, + "size": { + "type": "integer", + "description": "Unencrypted size of the file, in bytes", + "minimum": 0 + }, + "chunkSize": { + "type": "integer", + "description": "maxiumum size of every unencrypted file chunk in bytes", + "exclusiveMinimum": 0, + "examples": [ + 16777216 + ] + }, + "hash": { + "$ref": "https://skystandards.hns.siasky.net/draft-01/hash.schema.json", + "description": "Multihash of the unencrypted file, starts with 1220 for sha256" + }, + "ts": { + "type": "integer", + "description": "Unix timestamp (in milliseconds) when this version was added to the FileSystem DAC", + "minimum": 0 + } + }, + "required": [ + "url", + "key", + "encryptionType", + "chunkSize", + "hash", + "size", + "ts" + ] +} \ No newline at end of file