social/src/types/Mastodon.js

189 wiersze
9.0 KiB
JavaScript
Czysty Zwykły widok Historia

Use new Mastodon like API Revert "Revert "Merge pull request #1581 from nextcloud/artonge/feat/use_new_api"" This reverts commit c4eef0b2d476ffcf10cfc3a44ea426d3ec7587b4. Signed-off-by: Louis Chemineau <louis@chmn.me> Adapt views to new timeline api Signed-off-by: Louis Chemineau <louis@chmn.me> Add types Signed-off-by: Louis Chemineau <louis@chmn.me> Fix type errors Signed-off-by: Louis Chemineau <louis@chmn.me> Adapte front-end to mastodon data format + Add typing + Modernize code Signed-off-by: Louis Chemineau <louis@chmn.me> Use new API for media attachments + Split Composer.vue into tinier composent + Use blurhash value of attachments Signed-off-by: Louis Chemineau <louis@chmn.me> Fix media attachment rendering in post component Signed-off-by: Louis Chemineau <louis@chmn.me> Use square container to display statuses attachments Signed-off-by: Louis Chemineau <louis@chmn.me> Add typing to timeline.js And fix type errors Signed-off-by: Louis Chemineau <louis@chmn.me> Forward format to getStreamSelectSql for direct timeline Signed-off-by: Louis Chemineau <louis@chmn.me> Fix liked timeline Signed-off-by: Louis Chemineau <louis@chmn.me> Use new API for local and federated timelines Signed-off-by: Louis Chemineau <louis@chmn.me> Fix profile and avatar for local users Signed-off-by: Louis Chemineau <louis@chmn.me> Update babel config Signed-off-by: Louis Chemineau <louis@chmn.me> Improve typing in account.js Signed-off-by: Louis Chemineau <louis@chmn.me> Handle new notification format Signed-off-by: Louis Chemineau <louis@chmn.me> Fix follow button Signed-off-by: Louis Chemineau <louis@chmn.me> Fix condition of delete button for statuses Signed-off-by: Louis Chemineau <louis@chmn.me> Add relationship fetching Signed-off-by: Louis Chemineau <louis@chmn.me> Improve attachments viewer Signed-off-by: Louis Chemineau <louis@chmn.me> Correctly use twemoji Signed-off-by: Louis Chemineau <louis@chmn.me> Clean up composer Signed-off-by: Louis Chemineau <louis@chmn.me> Insert emoji on the last line instead of creating a new one Signed-off-by: Louis Chemineau <louis@chmn.me> Overall improvements in composer Signed-off-by: Louis Chemineau <louis@chmn.me> Clean up PreviewGridItem Signed-off-by: Louis Chemineau <louis@chmn.me> Fix fetching relationships Signed-off-by: Louis Chemineau <louis@chmn.me> Fix followers and following list Signed-off-by: Louis Chemineau <louis@chmn.me> Fix direct link to followers and following lists Signed-off-by: Louis Chemineau <louis@chmn.me> Fix notifications endpoint Signed-off-by: Louis Chemineau <louis@chmn.me> Handle different types of notifications Signed-off-by: Louis Chemineau <louis@chmn.me> Add formatted date as title for statuses Signed-off-by: Louis Chemineau <louis@chmn.me> Fix entryContent computed property Signed-off-by: Louis Chemineau <louis@chmn.me> Handle reblog Signed-off-by: Louis Chemineau <louis@chmn.me> Fix favourite type Signed-off-by: Louis Chemineau <louis@chmn.me> Load context of status for single post Signed-off-by: Louis Chemineau <louis@chmn.me> Use new format to set the uid in single post Signed-off-by: Louis Chemineau <louis@chmn.me> Fix display name property Signed-off-by: Louis Chemineau <louis@chmn.me> Hack to handle context of single post Signed-off-by: Louis Chemineau <louis@chmn.me> Use item id to fetch context Signed-off-by: Louis Chemineau <louis@chmn.me> Remove unsused variable Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-01-19 16:18:11 +00:00
/**
* @copyright Copyright (c) 2023 Louis Chmn <louis@chmn.me>
*
* @author Louis Chmn <louis@chmn.me>
*
* @license AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* @typedef Field
* @property {string} name - Ex: "Patreon"
* @property {string} value - Ex: "<a href=\"https://www.patreon.com/mastodon\" rel=\"me nofollow noopener noreferrer\" target=\"_blank\"><span class=\"invisible\">https://www.</span><span class=\"\">patreon.com/mastodon</span><span class=\"invisible\"></span}"
* @property {string} [verified_at] - Ex: "2019-12-08T03:48:33.901Z"
*/
/**
* @typedef Card
* @property {string} url - Ex: "https://www.theguardian.com/money/2019/dec/07/i-lost-my-193000-inheritance-with-one-wrong-digit-on-my-sort-code"
* @property {string} title - Ex: "I lost my £193,000 inheritance – with one wrong digit on my sort code"
* @property {string} description - Ex: "When Peter Teichs money went to another Barclays customer, the bank offered £25 as a token gesture"
* @property {string} type - Ex: "link"
* @property {string} author_name -
* @property {string} author_url -
* @property {string} provider_name -
* @property {string} provider_url -
* @property {string} html -
* @property {number} width - Ex: 0
* @property {number} height - Ex: 0
* @property {number} [image] -
* @property {string} embed_url -
*/
/**
* @typedef Poll - https://docs.joinmastodon.org/entities/Poll/
* @property {string} id - Ex: "34830"
* @property {string} expires_at - Ex: "2019-12-05T04:05:08.302Z"
* @property {boolean} expired - Ex: true
* @property {boolean} multiple - Ex: false
* @property {number} votes_count - Ex: 10
* @property {number} [voters_count] - null
* @property {boolean} voted - Ex: true
* @property {number[]} own_votes - Ex: [1]
* @property {PollOption[]} options - Ex: []
* @property {CustomEmoji[]} emojis - []
*/
/**
* @typedef PollOption
* @property {string} title - Ex: "accept"
* @property {number} votes_count - 6
*/
/**
* @typedef StatusMention - https://docs.joinmastodon.org/entities/Status/#Mention
* @property {string} id -
* @property {string} username -
* @property {string} url -
* @property {string} acct -
*/
/**
* @typedef StatusTag - https://docs.joinmastodon.org/entities/Status/#Tag
* @property {string} name -
* @property {string} url -
*/
/**
* @typedef MediaAttachment - https://docs.joinmastodon.org/entities/MediaAttachment
@property {string} id - Ex: "22345792"
@property {string} type - Ex: "image"
@property {string} url - Ex: "22345792"
@property {string} preview_url - Ex: "https://files.mastodon.social/media_attachments/files/022/345/792/small/57859aede991da25.jpeg"
@property {string} [remote_url] -
@property {object} meta -
@property {string} description - Ex: "test media description"
@property {string} blurhash - Ex: "UFBWY:8_0Jxv4mx]t8t64.%M-:IUWGWAt6M}"
*/
/**
* @typedef CustomEmoji
* @property {string} shortcode - Ex: "blobaww"
* @property {string} url - Ex: "https://files.mastodon.social/custom_emojis/images/000/011/739/original/blobaww.png"
* @property {string} static_url - Ex: "static_url": "https://files.mastodon.social/custom_emojis/images/000/011/739/static/blobaww.png"
* @property {boolean} visible_in_picker - Ex: "true"
* @property {string} category - Ex: "Blobs"
*/
/**
* @typedef Account - https://docs.joinmastodon.org/entities/Account
@property {string} id - Ex: "22345792"
* @property {string} username - Ex: "Gargron"
* @property {string} acct - Ex: "Gargron@example.com or Gargron for local users"
* @property {string} display_name - Ex: "Eugen"
* @property {boolean} locked - Ex: false
* @property {boolean} bot - Ex: false
* @property {number} discoverable - Ex: true
* @property {boolean} group - Ex: false
* @property {string} created_at - Ex: "2016-03-16T14:34:26.392Z"
* @property {string} note - Ex: "<p>Developer of Mastodon and administrator of mastodon.social. I post service announcements, development updates, and personal stuff.</p>"
* @property {string} url - Ex: "https://mastodon.social/@Gargron"
* @property {string} avatar - Ex: "https://files.mastodon.social/accounts/avatars/000/000/001/original/d96d39a0abb45b92.jpg"
* @property {string} avatar_static - Ex: "https://files.mastodon.social/accounts/avatars/000/000/001/original/d96d39a0abb45b92.jpg"
* @property {string} header - Ex: "https://files.mastodon.social/accounts/headers/000/000/001/original/c91b871f294ea63e.png"
* @property {string} header_static - Ex: "https://files.mastodon.social/accounts/headers/000/000/001/original/c91b871f294ea63e.png"
* @property {number} followers_count - Ex: 322930
* @property {number} following_count - Ex: 459
* @property {number} statuses_count - Ex: 61323
* @property {string} last_status_at - Ex: "2019-12-10T08:14:44.811Z"
* @property {CustomEmoji[]} emojis - Ex: []
* @property {Field[]} fields - Ex: []
*/
/**
* @typedef Status - https://docs.joinmastodon.org/entities/Status
* @property {string} id - Ex: "103270115826048975"
* @property {string} created_at - Ex: "2019-12-08T03:48:33.901Z"
* @property {string} [in_reply_to_id] - Ex: Ex: "103270115826048975"
* @property {number} [in_reply_to_account_id] - Ex: "1"
* @property {boolean} sensitive - Ex: false
* @property {string} spoiler_text -
* @property {string} visibility - Ex: "public"
* @property {string} language - Ex: "en"
* @property {string} uri - Ex: "https://mastodon.social/users/Gargron/statuses/103270115826048975"
* @property {string} url - Ex: "https://mastodon.social/@Gargron/103270115826048975"
* @property {number} replies_count - Ex: 5
* @property {number} reblogs_count - Ex: 6
* @property {number} favourites_count - Ex: 11
* @property {boolean} [favourited] - Ex: false
* @property {boolean} [reblogged] - Ex: false
* @property {boolean} [muted] - Ex: false
* @property {boolean} [bookmarked] - Ex: false
* @property {string} content - Ex: "<p>&quot;I lost my inheritance with one wrong digit on my sort code&quot;</p><p><a href=\"https://www.theguardian.com/money/2019/dec/07/i-lost-my-193000-inheritance-with-one-wrong-digit-on-my-sort-code\" rel=\"nofollow noopener noreferrer\" target=\"_blank\"><span class=\"invisible\">https://www.</span><span class=\"ellipsis\">theguardian.com/money/2019/dec</span><span class=\"invisible\">/07/i-lost-my-193000-inheritance-with-one-wrong-digit-on-my-sort-code</span}</p>"
* @property {Status} [reblog] - Ex: null
* @property {object} [application] -
* @property {string} application.name - Ex: "Web"
* @property {string} [application.website] - Ex: null
* @property {Account} account -
* @property {MediaAttachment[]} media_attachments - Ex: []
* @property {StatusMention[]} mentions - Ex: []
* @property {StatusTag[]} tags - Ex: []
* @property {CustomEmoji[]} emojis - Ex: []
* @property {Card} card -
* @property {Poll} [poll] - Ex: null
*/
/**
* @typedef Notification - https://docs.joinmastodon.org/entities/Notification
* @property {string} id - Ex: "https://example.com/users/@tommy""
* @property {"mention"|"status"|"reblog"|"follow"|"follow_request"|"favourite"|"poll"|"update"|"admin.sign_up"|"admin.report"} type - Ex: "2016-03-16T14:34:26.392Z"
* @property {string} created_at - Ex: "2016-03-16T14:34:26.392Z"
* @property {Account} account -
* @property {Status} [status] -
* @property {any} [report] -
*/
/**
* @typedef Relationship - https://docs.joinmastodon.org/entities/Relationship
* @property {string} id - The account ID. Ex: "https://example.com/users/@tommy""
* @property {boolean} following - Are you following this user?
* @property {boolean} showing_reblogs - Are you receiving this users boosts in your home timeline?
* @property {boolean} notifying - Have you enabled notifications for this user?
* @property {string[]} languages - Which languages are you following from this user?
* @property {boolean} followed_by - Are you followed by this user?
* @property {boolean} blocking - Are you blocking this user?
* @property {boolean} blocked_by - Is this user blocking you?
* @property {boolean} muting - Are you muting this user?
* @property {boolean} muting_notifications - Are you muting notifications from this user?
* @property {boolean} requested - Do you have a pending follow request for this user?
* @property {boolean} domain_blocking - Are you blocking this users domain?
* @property {boolean} endorsed - Are you featuring this user on your profile?
* @property {string} note - This users profile bio
*/
export default {}