2024-01-23 01:52:51 +01:00
|
|
|
const MbViewerTrasformapiSchema = `<schema>
|
|
|
|
|
2024-01-24 01:04:43 +01:00
|
|
|
<set
|
|
|
|
rss-media-query="*[name()='media:content' or name()='enclosure']"
|
|
|
|
/>
|
|
|
|
|
2024-01-23 01:52:51 +01:00
|
|
|
<!-- WIP, find out how to structure this -->
|
|
|
|
<endpoint name="messages">
|
|
|
|
<method name="GET" args="" returns="message[]"/>
|
|
|
|
<!-- ... -->
|
|
|
|
</endpoint>
|
|
|
|
|
|
|
|
<entity name="message">
|
|
|
|
<prop name="id" type="int">
|
2024-01-24 01:04:43 +01:00
|
|
|
<content upstream="rss" query="./guid"/>
|
|
|
|
<content upstream="wordpress.com" query="//ID"/>
|
|
|
|
<content upstream="wordpress.org" query="//id"/>
|
|
|
|
<content upstream="mastodon" query="//id"/>
|
2024-01-23 01:52:51 +01:00
|
|
|
</prop>
|
|
|
|
<prop name="url" type="string">
|
2024-01-24 01:04:43 +01:00
|
|
|
<content upstream="rss" query="./link"/>
|
|
|
|
<content upstream="wordpress.com" query="//URL"/>
|
|
|
|
<content upstream="wordpress.org" query="//link"/>
|
|
|
|
<content upstream="mastodon" query="//url"/>
|
2024-01-23 01:52:51 +01:00
|
|
|
</prop>
|
|
|
|
<prop name="title" type="string">
|
2024-01-24 01:04:43 +01:00
|
|
|
<content upstream="rss" query="title"/>
|
|
|
|
<content upstream="wordpress.com" query="//title"/>
|
|
|
|
<content upstream="wordpress.org" query="//title/rendered"/>
|
2024-01-23 01:52:51 +01:00
|
|
|
</prop>
|
|
|
|
<prop name="content" type="string">
|
2024-01-24 01:04:43 +01:00
|
|
|
<!-- TODO optional multiple 'query' attrs -->
|
|
|
|
<!--<content upstream="rss" query="content:encoded"/>-->
|
|
|
|
<content upstream="rss" query="./description"/>
|
|
|
|
<content upstream="wordpress.com" query="//content"/>
|
|
|
|
<content upstream="wordpress.org" query="//content/rendered"/>
|
|
|
|
<content upstream="mastodon" query="//content"/>
|
|
|
|
</prop>
|
2024-01-23 01:52:51 +01:00
|
|
|
<prop name="attachments" type="file[]">
|
|
|
|
<content upstream="rss">
|
2024-01-24 01:04:43 +01:00
|
|
|
<prop name="url" query="{rss-media-query}/@url"/>
|
|
|
|
<prop name="type" query="{rss-media-query}/@type"/>
|
|
|
|
<prop name="description" query="{rss-media-query}/*[name()='media:description']"/>
|
|
|
|
</content>
|
|
|
|
<!--
|
|
|
|
<content upstream="mastodon">
|
|
|
|
<prop name="url" query="media_attachments.url"/>
|
|
|
|
<prop name="type" query="media_attachments.type"/>
|
2024-01-23 01:52:51 +01:00
|
|
|
</content>
|
2024-01-24 01:04:43 +01:00
|
|
|
-->
|
|
|
|
<content upstream="mastodon" query="//media_attachments"/>
|
2024-01-23 01:52:51 +01:00
|
|
|
</prop>
|
|
|
|
<prop name="author" type="profile">
|
|
|
|
<content upstream="rss"/>
|
2024-01-24 01:04:43 +01:00
|
|
|
<content upstream="wordpress.com" query="//author"/>
|
2024-01-23 01:52:51 +01:00
|
|
|
<content upstream="wordpress.org"/>
|
2024-01-24 01:04:43 +01:00
|
|
|
<content upstream="mastodon" query="//account"/>
|
2024-01-23 01:52:51 +01:00
|
|
|
</prop>
|
|
|
|
<prop name="time" type="string">
|
2024-01-24 01:04:43 +01:00
|
|
|
<content upstream="rss" query="pubDate"/>
|
|
|
|
<content upstream="wordpress.com" query="//date"/>
|
|
|
|
<content upstream="wordpress.org" query="//date"/>
|
|
|
|
<content upstream="mastodon" query="//created_at"/>
|
2024-01-23 01:52:51 +01:00
|
|
|
</prop>
|
|
|
|
<prop name="revisions" type="revision[]">
|
|
|
|
<content upstream="wordpress.com"/>
|
|
|
|
<content upstream="wordpress.org"/>
|
|
|
|
<content upstream="mastodon"/>
|
|
|
|
</prop>
|
|
|
|
<prop name="quoting" type="message">
|
2024-01-24 01:04:43 +01:00
|
|
|
<content upstream="mastodon" query="//reblog"/>
|
2024-01-23 01:52:51 +01:00
|
|
|
</prop>
|
|
|
|
<!--<prop name="replying" type="message">
|
2024-01-24 01:04:43 +01:00
|
|
|
<content upstream="mastodon" query=""/>
|
2024-01-23 01:52:51 +01:00
|
|
|
</prop>-->
|
|
|
|
</entity>
|
|
|
|
|
|
|
|
<entity name="revision">
|
|
|
|
<prop name="time" type="string">
|
2024-01-24 01:04:43 +01:00
|
|
|
<content upstream="wordpress.com" query="//modified"/>
|
|
|
|
<content upstream="wordpress.org" query="//modified"/>
|
|
|
|
<content upstream="mastodon" query="//edited_at"/>
|
2024-01-23 01:52:51 +01:00
|
|
|
</prop>
|
|
|
|
</entity>
|
|
|
|
|
|
|
|
<!-- TODO (for wordpress) how to handle both authors and sites as a profile type? maybe add a 'variant' attr for 'content' tags? -->
|
|
|
|
<entity name="profile">
|
2024-01-24 01:04:43 +01:00
|
|
|
<prop name="id" type="int"> <!-- TODO fix type -->
|
|
|
|
<content upstream="rss" query="link"/>
|
|
|
|
<content upstream="wordpress.com" query="//ID"/>
|
|
|
|
<content upstream="wordpress.org" query="//author"/>
|
2024-01-23 01:52:51 +01:00
|
|
|
</prop>
|
|
|
|
<prop name="url" type="string">
|
2024-01-24 01:04:43 +01:00
|
|
|
<content upstream="rss" query="link"/>
|
|
|
|
<content upstream="wordpress.com" query="//profile_URL"/>
|
2024-01-23 01:52:51 +01:00
|
|
|
</prop>
|
|
|
|
<prop name="name" type="string">
|
2024-01-24 01:04:43 +01:00
|
|
|
<content upstream="rss" query="*[name()='title' or name()='dc:creator']"/>
|
|
|
|
<content upstream="wordpress.com" query="//name"/>
|
|
|
|
<content upstream="mastodon" query="//title"/>
|
|
|
|
</prop>
|
|
|
|
<prop name="description" type="string">
|
|
|
|
<content upstream="rss" query="description"/>
|
|
|
|
<content upstream="mastodon" query="//description"/>
|
2024-01-23 01:52:51 +01:00
|
|
|
</prop>
|
|
|
|
<prop name="icon" type="file">
|
2024-01-24 01:04:43 +01:00
|
|
|
<content upstream="rss">
|
|
|
|
<prop name="url" query="image/url"/>
|
|
|
|
</content>
|
2024-01-23 01:52:51 +01:00
|
|
|
<content upstream="wordpress.com">
|
2024-01-24 01:04:43 +01:00
|
|
|
<prop name="url" query="//avatar_URL"/>
|
|
|
|
</content>
|
|
|
|
<content upstream="mastodon"> <!-- TODO read user avatars -->
|
|
|
|
<!--<prop name="url" query="//thumbnail/url"/>-->
|
|
|
|
<prop name="url" query="//contact/account/avatar"/>
|
2024-01-23 01:52:51 +01:00
|
|
|
</content>
|
|
|
|
</prop>
|
|
|
|
</entity>
|
|
|
|
|
|
|
|
<entity name="file">
|
2024-01-24 01:04:43 +01:00
|
|
|
<prop name="url" type="string">
|
|
|
|
<content upstream="mastodon" query="//url"/>
|
|
|
|
</prop>
|
|
|
|
<prop name="type" type="string">
|
|
|
|
<content upstream="mastodon" query="//type"/>
|
|
|
|
</prop>
|
|
|
|
<prop name="description" type="string"/>
|
2024-01-23 01:52:51 +01:00
|
|
|
</entity>
|
|
|
|
|
|
|
|
</schema>`;
|