designing v2 paste & comment format

This commit is contained in:
El RIDO 2018-12-17 19:43:16 +01:00
parent cde96d8f24
commit c15351b793
No known key found for this signature in database
GPG Key ID: 0F5C940A6BD81F92
5 changed files with 239 additions and 31 deletions

View File

@ -1,16 +1,32 @@
{
"@context": {
"so": "https://schema.org/",
"status": "so:Integer",
"id": "so:name",
"parentid": "so:name",
"url: {
"@id": "so:url",
"@type": "@id"
"pb": "?jsonld=types#",
"cm": "?jsonld=commentmeta#",
"status": {
"@type": "so:Integer"
},
"id": {
"@type": "so:name"
},
"parentid": {
"@type": "so:name"
},
"url": {
"@type": "so:url"
},
"v": {
"@type": "so:Integer",
"@value": 2
},
"ct": {
"@type": "pb:CipherText"
},
"adata": {
"@type": "cm:AuthenticatedData"
},
"data": "so:Text",
"meta": {
"@id": "?jsonld=commentmeta"
}
"@type": "cm:MetaData"
},
}
}

View File

@ -1,8 +1,43 @@
{
"@context": {
"so": "https://schema.org/",
"postdate": "so:Integer",
"nickname": "so:Text",
"vizhash": "so:Text"
"pb": "?jsonld=types#"
},
"AuthenticatedData": {
"@container": "@list",
"@value": [
{
"@type": "pb:InitializationVector"
},
{
"@type": "pb:Salt"
},
{
"@type": "pb:Iterations"
},
{
"@type": "pb:KeySize"
},
{
"@type": "pb:TagSize"
},
{
"@type": "pb:Algorithm"
},
{
"@type": "pb:Mode"
},
{
"@type": "pb:Compression"
}
]
},
"MetaData": {
"created": {
"@type": "CreationTime"
},
"icon": {
"@type": "so:url"
}
}
}

View File

@ -1,24 +1,42 @@
{
"@context": {
"so": "https://schema.org/",
"status": {"@id": "so:Integer"},
"id": {"@id": "so:name"},
"deletetoken": {"@id": "so:Text"},
"url": {
"@type": "@id",
"@id": "so:url"
"pb": "?jsonld=types#",
"pm": "?jsonld=pastemeta#",
"status": {
"@type": "so:Integer"
},
"id": {
"@type": "so:name"
},
"deletetoken": {
"@type": "so:Text"
},
"url": {
"@type": "so:url"
},
"v": {
"@type": "so:Integer",
"@value": 2
},
"ct": {
"@type": "pb:CipherText"
},
"adata": {
"@type": "pm:AuthenticatedData"
},
"data": {"@id": "so:Text"},
"attachment": {"@id": "so:Text"},
"attachmentname": {"@id": "so:Text"},
"meta": {
"@id": "?jsonld=pastemeta"
"@type": "pm:MetaData"
},
"comments": {
"@id": "?jsonld=comment",
"@type": "?jsonld=comment",
"@container": "@list"
},
"comment_count": {"@id": "so:Integer"},
"comment_offset": {"@id": "so:Integer"}
"comment_count": {
"@type": "so:Integer"
},
"comment_offset": {
"@type": "so:Integer"
}
}
}

View File

@ -1,11 +1,55 @@
{
"@context": {
"so": "https://schema.org/",
"formatter": {"@id": "so:Text"},
"postdate": {"@id": "so:Integer"},
"opendiscussion": {"@id": "so:True"},
"burnafterreading": {"@id": "so:True"},
"expire_date": {"@id": "so:Integer"},
"remaining_time": {"@id": "so:Integer"}
"pb": "?jsonld=types#"
},
"AuthenticatedData": {
"@container": "@list",
"@value": [
{
"@type": "pb:InitializationVector"
},
{
"@type": "pb:Salt"
},
{
"@type": "pb:Iterations"
},
{
"@type": "pb:KeySize"
},
{
"@type": "pb:TagSize"
},
{
"@type": "pb:Algorithm"
},
{
"@type": "pb:Mode"
},
{
"@type": "pb:Compression"
},
{
"@type": "pb:Formatter"
},
{
"@type": "pb:OpenDiscussion"
},
{
"@type": "pb:BurnAfterReading"
},
{
"@type": "pb:Expire"
}
]
},
"MetaData": {
"created": {
"@type": "pb:CreationTime"
},
"time_to_live": {
"@type": "pb:RemainingSeconds"
}
}
}

95
js/types.jsonld Normal file
View File

@ -0,0 +1,95 @@
{
"@context": {
"so": "https://schema.org/",
"dp": "http://dbpedia.org/resource/",
"pb": "?jsonld=types#"
},
"Base64": {
"@type": "so:Text"
},
"CipherText": {
"@type": "pb:Base64"
},
"PasteCipherMessage": {
"paste": {
"@type": "so:Text"
},
"attachment": {
"@type": "so:MediaObject"
},
"attachment_name": {
"@type": "so:Text"
}
},
"CommentCipherMessage": {
"comment": {
"@type": "so:Text"
},
"nickname": {
"@type": "so:Text"
}
},
"InitializationVector": {
"@type": "pb:Base64"
},
"Salt": {
"@type": "pb:Base64"
},
"Iterations": {
"@type": "so:Integer",
"@minimum": 1
},
"KeySize": {
"@type": "so:Integer",
"@value": 256,
"@minimum": 128,
"@maximum": 256,
"@enum": [128, 196, 256]
},
"TagSize": {
"@type": "so:Integer",
"@value": 128,
"@minimum": 32,
"@maximum": 128,
"@enum": [32, 64, 96, 104, 112, 120, 128]
},
"Algorithm": {
"@type": "so:Text",
"@value": "aes"
},
"Mode": {
"@type": "so:Text",
"@value": "gcm",
"@enum": ["ctr", "cbc", "gcm"]
},
"Compression": {
"@type": "so:Text",
"@value": "zlib",
"@enum": ["zlib", "none"]
},
"Formatter": {
"@type": "so:Text",
"@value": "plaintext",
"@enum": ["plaintext", "syntaxhighlighting", "markdown"]
},
"Expire": {
"@type": "so:Text",
"@value": "1week",
"@enum": ["5min", "10min", "1hour", "1day", "1week", "1month", "1year", "never"]
},
"OpenDiscussion": {
"@type": "so:Boolean",
"@enum": [false, true]
},
"BurnAfterReading": {
"@type": "so:Boolean",
"@enum": [false, true]
},
"CreationTime": {
"@type": "dp:Unix_time"
},
"RemainingSeconds": {
"@type": "dp:Second",
"@minimum": 1
}
}