Following our Links migration to graph-store, our next application to migrate will be Publish. We expect it to deploy within the next week. This document is intended to help outline, for those of you making clients, how the JSON data structure is changing.
Given that:
- we have one notebook by
~zod
called "A new notebook", - with one post in it, titled "A note,"
- with the content "With content in it", and
- one comment that simply says "And a comment"...
{
notebooks: {
~zod: {
a-new-notebook: {
about: "",
comments: true,
date-created: 1602889710825,
notes: {
a-note: {
author: "~zod",
comments: [
{
~2020.10.16..23.08.53..e9ba: {
author: "~zod",
content: "And a comment",
date-created: 1602889733913,
pending: false
}
}
],
date-created: 1602889728234,
file: ":- :~
[%author '~zod']
[%last-modified '~2020.10.16..23.08.48..3bf0']
[%title 'A note']
[%date-created '~2020.10.16..23.08.48..3bf0']
==
;>
With content in it",
next-note: null,
note-id: "a-note",
num-comments: 1,
pending: false,
prev-note: null,
read: true,
snippet: "With content in it",
title: "A note"
}
},
notes-by-date: [
"a-note"
],
num-notes: 2,
num-unread: 0,
subscribers: [],
subscribers-group-path: "/ship/~zod/a-new-notebook",
title: "A new notebook",
writers: ["~zod"],
writers-group-path: "/ship/~zod/a-new-notebook"
}
}
}
}
{
graphs: {
zod/a-new-notebook: Map([
0: {
key: 1602887908525,
value: {
children: Map([
0: {
key: 2,
value: {
children: Map([
0: {
key: 1602887912438,
value: {
children: Map([]),
post: {
author: zod,
contents: [
{
text: "And a comment"
}
],
hash: null,
index: "/1602887908525/2/1602887912438",
signatures: [],
time-sent: 1602887912438
}
}
}
]),
post: {
author: "zod",
contents: [],
hash: null,
index: "/1602887908525/2",
signatures: [],
time-sent: 1602887908525
}
}
},
1: {
key: 1,
value: {
children: Map([
0: {
key: 1,
value: {
children: Map([]),
post: {
author: "zod",
contents: [
{
text: "A note"
},
{
text: "With content in it"
}
],
hash: null,
index: "/1602887908525/1/1",
signatures: [],
time-sent: 1602887908525
}
}
}
]),
post: {
author: "zod",
contents: [],
hash: null,
index: "/1602887908525/1",
signatures: [],
time-sent: 1602887908525
}
}
}
]),
post: {
author: "zod",
contents: [],
hash: null,
index: "/1602887908525",
signatures: [],
time-sent: 1602887908525
}
}
}
])
}
}
The title is the first item in the
contents
array. To clarify:A publish notebook is now a graph in graph-store.
A publish note is a top-level node on this graph. This top level node has two children
1
and2
.1
is a container for all the revisions of the note, keyed by date.2
is a container for comments. The children of1
are the revisions themselves, with the title as the first item in thecontents
array and the actual content as the second item. The children of2
are simply comments, whose contents are a one-item array of the content of the comment. This may be easier to grok (if you can read hoon) by looking at the validator mark