splitbee / notion-api-worker

Notion as CMS with easy API access
MIT License
1.56k stars 197 forks source link

Support relations #5

Closed dvdsgl closed 4 years ago

dvdsgl commented 4 years ago

Notion relations appear to be encoded like this:

[
  ["‣", ["p", "1DC1624C-8FCC-43E7-A07E-B41C297407D4"]],
  [","],
  ["‣", ["p", "7D80DB84-022E-41E8-B7FB-8E454CF14AC7"]],
  ...
  [","],
  ["‣", ["p", "2D2AA7BB-3A97-434F-8A33-4E7FD690E4C3"]]
]

I transform values of the shape:

[
  ["‣", [_, "id0"]],
  ...
  ["‣", [_, "idn"]]
]

into ["id0", ..., "idn"].