From a35308fc19da1de6907625f83fc11bf7c2ed77d3 Mon Sep 17 00:00:00 2001 From: redsolver Date: Sun, 11 Apr 2021 11:23:24 +0200 Subject: [PATCH 1/2] Moved timestamp from PostContent to Post and changed reference format to support DACs --- draft-01/example.json | 7 ++++--- draft-01/feedPage.schema.json | 9 ++++----- draft-01/post.schema.json | 5 +++++ draft-01/postContent.schema.json | 5 ----- draft-01/postReference.schema.json | 9 +++++---- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/draft-01/example.json b/draft-01/example.json index c462d4f..abb48c3 100644 --- a/draft-01/example.json +++ b/draft-01/example.json @@ -1,11 +1,12 @@ { "$schema": "../draft-01/feedPage.schema.json", - "userId": "d448f1562c20dbafa42badd9f88560cd1adb2f177b30f0aa048cb243e55d37bd", + "_self": "sky://ed25519-d448f1562c20dbafa42badd9f88560cd1adb2f177b30f0aa048cb243e55d37bd/skyfeed-dev.hns/localhost/posts/page_1.json", "items": [ { "id": 0, - "commentTo": "a3a35179d69a191ccb6329dcc0c2aaac2cada7ce145cbbd5543c8c2ee97e2a4a/feed/comments/102123/123213", - "parentHash": "sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", + "commentTo": "sky://ed25519-9887c9b067418549277a5f990e468b33d57f959cb08d8663f9563c376d0c9b34/skyfeed-dev.hns/localhost/posts/page_0.json#0", + "parentHash": "122041dd7b6443542e75701aa98a0c235951a28a0d851b11564d20022ab11d2589a8", + "ts": 1618130245000, "content": { "link": "sia://hackerpaste.hns/#AACxgn3_eeq4yScptvec8aViIsNvsahDO8Z8EAFQ87aLSQugUdJE-YeTvjeTBiVsjg", "linkTitle": "HackerPaste Link", diff --git a/draft-01/feedPage.schema.json b/draft-01/feedPage.schema.json index 2808ea6..ccd14dc 100644 --- a/draft-01/feedPage.schema.json +++ b/draft-01/feedPage.schema.json @@ -4,14 +4,13 @@ "description": "A representation of a page of a feed", "type": "object", "required": [ - "userId", + "_self", "items" ], "properties": { - "userId": { - "type": "string", - "description": "This is the global userId used for the profile (for example by SkyID), not the scope-specific public key (To ensure interoperability)", - "pattern": "^[\\da-f]{64}$" + "_self": { + "$ref": "../draft-01/postReference.schema.json", + "description": "Reference to this page" }, "items": { "type": "array", diff --git a/draft-01/post.schema.json b/draft-01/post.schema.json index 987ce38..2b0a90b 100644 --- a/draft-01/post.schema.json +++ b/draft-01/post.schema.json @@ -40,6 +40,11 @@ }, "content": { "$ref": "../draft-01/postContent.schema.json" + }, + "ts": { + "type": "integer", + "description": "Unix timestamp (in milliseconds) when this post was created/posted", + "minimum": 0 } } } \ No newline at end of file diff --git a/draft-01/postContent.schema.json b/draft-01/postContent.schema.json index 41d1380..6646b55 100644 --- a/draft-01/postContent.schema.json +++ b/draft-01/postContent.schema.json @@ -112,11 +112,6 @@ }, "description": "Can be used by applications to add more metadata" }, - "ts": { - "type": "integer", - "description": "Unix timestamp (in millisecons) when this post was created/posted", - "minimum": 0 - }, "lang": { "type": "string", "description": "ISO 639-1 Alpha-2 language code", diff --git a/draft-01/postReference.schema.json b/draft-01/postReference.schema.json index c6dd0ba..c3fc537 100644 --- a/draft-01/postReference.schema.json +++ b/draft-01/postReference.schema.json @@ -1,11 +1,12 @@ { "$id": "https://skystandards.hns.siasky.net/draft-01/postReference.schema.json", "$schema": "http://json-schema.org/draft-07/schema#", - "title": "A reference to a Post", - "description": "A reference to a Post", + "title": "A reference to a Post or FeedPage", + "description": "A reference to a Post or FeedPage (sky://USERID/DAC/SKAPP/FEED/PAGE#INDEX)", "type": "string", - "pattern": "^[\\da-f]{64}\\/feed\\/\\w+\\/\\d+\\/\\d+$", + "pattern": "^sky:\\/\\/ed25519-[\\da-f]{64}\\/[a-z\\.\\-]+\\/[a-z\\.\\-]+\\/[a-z\\.\\-]+\\/[\\w_\\.]+(#\\d+)?$", "examples": [ - "5335179d69a3191ccb6329dcc0d2aaac2cada7ce145cbbd5543c8c2ee97e2a4a/feed/posts/0/11" + "sky://ed25519-9887c9b067418549277a5f990e468b33d57f959cb08d8663f9563c376d0c9b34/skyfeed-dev.hns/localhost/posts/page_0.json#0", + "sky://ed25519-d448f1562c20dbafa42badd9f88560cd1adb2f177b30f0aa048cb243e55d37bd/skyfeed-dev.hns/localhost/posts/page_1.json" ] } \ No newline at end of file From 316af4b887f26d4a681147fefa166a75ab7c598c Mon Sep 17 00:00:00 2001 From: redsolver Date: Mon, 12 Apr 2021 18:06:46 +0200 Subject: [PATCH 2/2] Timestamp is now required for a post --- draft-01/post.schema.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/draft-01/post.schema.json b/draft-01/post.schema.json index 2b0a90b..54af7be 100644 --- a/draft-01/post.schema.json +++ b/draft-01/post.schema.json @@ -4,7 +4,8 @@ "description": "A representation of a post", "type": "object", "required": [ - "id" + "id", + "ts" ], "properties": { "id": {