From afda15260f4f97ec00b3e7fdf63bd13013daae40 Mon Sep 17 00:00:00 2001 From: Mar0xy Date: Sun, 24 Sep 2023 01:44:53 +0200 Subject: upd: megalodon to v7 --- packages/megalodon/src/entities/account.ts | 52 ++++++++------ packages/megalodon/src/entities/activity.ts | 12 ++-- packages/megalodon/src/entities/announcement.ts | 62 ++++++++-------- packages/megalodon/src/entities/application.ts | 10 +-- .../megalodon/src/entities/async_attachment.ts | 22 +++--- packages/megalodon/src/entities/attachment.ts | 84 +++++++++++----------- packages/megalodon/src/entities/card.ts | 30 ++++---- packages/megalodon/src/entities/context.ts | 8 +-- packages/megalodon/src/entities/conversation.ts | 12 ++-- packages/megalodon/src/entities/emoji.ts | 14 ++-- packages/megalodon/src/entities/featured_tag.ts | 12 ++-- packages/megalodon/src/entities/field.ts | 10 +-- packages/megalodon/src/entities/filter.ts | 18 ++--- packages/megalodon/src/entities/follow_request.ts | 27 +++++++ packages/megalodon/src/entities/history.ts | 10 +-- packages/megalodon/src/entities/identity_proof.ts | 14 ++-- packages/megalodon/src/entities/instance.ts | 69 +++++++++--------- packages/megalodon/src/entities/list.ts | 11 +-- packages/megalodon/src/entities/marker.ts | 26 +++---- packages/megalodon/src/entities/mention.ts | 12 ++-- packages/megalodon/src/entities/notification.ts | 19 ++--- packages/megalodon/src/entities/poll.ts | 19 +++-- packages/megalodon/src/entities/poll_option.ts | 8 +-- packages/megalodon/src/entities/preferences.ts | 14 ++-- .../megalodon/src/entities/push_subscription.ts | 26 +++---- packages/megalodon/src/entities/reaction.ts | 14 ++-- packages/megalodon/src/entities/relationship.ts | 30 ++++---- packages/megalodon/src/entities/report.ts | 23 ++++-- packages/megalodon/src/entities/results.ts | 10 +-- packages/megalodon/src/entities/role.ts | 5 ++ .../megalodon/src/entities/scheduled_status.ts | 12 ++-- packages/megalodon/src/entities/source.ts | 14 ++-- packages/megalodon/src/entities/stats.ts | 10 +-- packages/megalodon/src/entities/status.ts | 72 ++++++++++--------- packages/megalodon/src/entities/status_params.ts | 20 +++--- packages/megalodon/src/entities/status_source.ts | 7 ++ packages/megalodon/src/entities/tag.ts | 12 ++-- packages/megalodon/src/entities/token.ts | 12 ++-- packages/megalodon/src/entities/urls.ts | 6 +- 39 files changed, 458 insertions(+), 390 deletions(-) create mode 100644 packages/megalodon/src/entities/follow_request.ts create mode 100644 packages/megalodon/src/entities/role.ts create mode 100644 packages/megalodon/src/entities/status_source.ts (limited to 'packages/megalodon/src/entities') diff --git a/packages/megalodon/src/entities/account.ts b/packages/megalodon/src/entities/account.ts index 06a85eb98e..89c0f17c4b 100644 --- a/packages/megalodon/src/entities/account.ts +++ b/packages/megalodon/src/entities/account.ts @@ -1,27 +1,35 @@ /// /// /// +/// namespace Entity { - export type Account = { - id: string; - username: string; - acct: string; - display_name: string; - locked: boolean; - created_at: string; - followers_count: number; - following_count: number; - statuses_count: number; - note: string; - url: string; - avatar: string; - avatar_static: string; - header: string; - header_static: string; - emojis: Array; - moved: Account | null; - fields: Array; - bot: boolean | null; - source?: Source; - }; + export type Account = { + id: string + username: string + acct: string + display_name: string + locked: boolean + discoverable?: boolean + group: boolean | null + noindex: boolean | null + suspended: boolean | null + limited: boolean | null + created_at: string + followers_count: number + following_count: number + statuses_count: number + note: string + url: string + avatar: string + avatar_static: string + header: string + header_static: string + emojis: Array + moved: Account | null + fields: Array + bot: boolean | null + source?: Source + role?: Role + mute_expires_at?: string + } } diff --git a/packages/megalodon/src/entities/activity.ts b/packages/megalodon/src/entities/activity.ts index 6bc0b6d80e..2494916a92 100644 --- a/packages/megalodon/src/entities/activity.ts +++ b/packages/megalodon/src/entities/activity.ts @@ -1,8 +1,8 @@ namespace Entity { - export type Activity = { - week: string; - statuses: string; - logins: string; - registrations: string; - }; + export type Activity = { + week: string + statuses: string + logins: string + registrations: string + } } diff --git a/packages/megalodon/src/entities/announcement.ts b/packages/megalodon/src/entities/announcement.ts index 7c79831634..0db9c23bbe 100644 --- a/packages/megalodon/src/entities/announcement.ts +++ b/packages/megalodon/src/entities/announcement.ts @@ -1,34 +1,40 @@ -/// /// -/// namespace Entity { - export type Announcement = { - id: string; - content: string; - starts_at: string | null; - ends_at: string | null; - published: boolean; - all_day: boolean; - published_at: string; - updated_at: string; - read?: boolean; - mentions: Array; - statuses: Array; - tags: Array; - emojis: Array; - reactions: Array; - }; + export type Announcement = { + id: string + content: string + starts_at: string | null + ends_at: string | null + published: boolean + all_day: boolean + published_at: string + updated_at: string | null + read: boolean | null + mentions: Array + statuses: Array + tags: Array + emojis: Array + reactions: Array + } - export type AnnouncementAccount = { - id: string; - username: string; - url: string; - acct: string; - }; + export type AnnouncementAccount = { + id: string + username: string + url: string + acct: string + } - export type AnnouncementStatus = { - id: string; - url: string; - }; + export type AnnouncementStatus = { + id: string + url: string + } + + export type AnnouncementReaction = { + name: string + count: number + me: boolean | null + url: string | null + static_url: string | null + } } diff --git a/packages/megalodon/src/entities/application.ts b/packages/megalodon/src/entities/application.ts index 9b98b12772..3af64fcf96 100644 --- a/packages/megalodon/src/entities/application.ts +++ b/packages/megalodon/src/entities/application.ts @@ -1,7 +1,7 @@ namespace Entity { - export type Application = { - name: string; - website?: string | null; - vapid_key?: string | null; - }; + export type Application = { + name: string + website?: string | null + vapid_key?: string | null + } } diff --git a/packages/megalodon/src/entities/async_attachment.ts b/packages/megalodon/src/entities/async_attachment.ts index 9cc17acc5c..b383f90c58 100644 --- a/packages/megalodon/src/entities/async_attachment.ts +++ b/packages/megalodon/src/entities/async_attachment.ts @@ -1,14 +1,14 @@ /// namespace Entity { - export type AsyncAttachment = { - id: string; - type: "unknown" | "image" | "gifv" | "video" | "audio"; - url: string | null; - remote_url: string | null; - preview_url: string; - text_url: string | null; - meta: Meta | null; - description: string | null; - blurhash: string | null; - }; + export type AsyncAttachment = { + id: string + type: 'unknown' | 'image' | 'gifv' | 'video' | 'audio' + url: string | null + remote_url: string | null + preview_url: string + text_url: string | null + meta: Meta | null + description: string | null + blurhash: string | null + } } diff --git a/packages/megalodon/src/entities/attachment.ts b/packages/megalodon/src/entities/attachment.ts index 082c79eddb..aab1deadea 100644 --- a/packages/megalodon/src/entities/attachment.ts +++ b/packages/megalodon/src/entities/attachment.ts @@ -1,49 +1,49 @@ namespace Entity { - export type Sub = { - // For Image, Gifv, and Video - width?: number; - height?: number; - size?: string; - aspect?: number; + export type Sub = { + // For Image, Gifv, and Video + width?: number + height?: number + size?: string + aspect?: number - // For Gifv and Video - frame_rate?: string; + // For Gifv and Video + frame_rate?: string - // For Audio, Gifv, and Video - duration?: number; - bitrate?: number; - }; + // For Audio, Gifv, and Video + duration?: number + bitrate?: number + } - export type Focus = { - x: number; - y: number; - }; + export type Focus = { + x: number + y: number + } - export type Meta = { - original?: Sub; - small?: Sub; - focus?: Focus; - length?: string; - duration?: number; - fps?: number; - size?: string; - width?: number; - height?: number; - aspect?: number; - audio_encode?: string; - audio_bitrate?: string; - audio_channel?: string; - }; + export type Meta = { + original?: Sub + small?: Sub + focus?: Focus + length?: string + duration?: number + fps?: number + size?: string + width?: number + height?: number + aspect?: number + audio_encode?: string + audio_bitrate?: string + audio_channel?: string + } - export type Attachment = { - id: string; - type: "unknown" | "image" | "gifv" | "video" | "audio"; - url: string; - remote_url: string | null; - preview_url: string | null; - text_url: string | null; - meta: Meta | null; - description: string | null; - blurhash: string | null; - }; + export type Attachment = { + id: string + type: 'unknown' | 'image' | 'gifv' | 'video' | 'audio' + url: string + remote_url: string | null + preview_url: string | null + text_url: string | null + meta: Meta | null + description: string | null + blurhash: string | null + } } diff --git a/packages/megalodon/src/entities/card.ts b/packages/megalodon/src/entities/card.ts index 356d99aee4..1ef6f5e4d6 100644 --- a/packages/megalodon/src/entities/card.ts +++ b/packages/megalodon/src/entities/card.ts @@ -1,16 +1,18 @@ namespace Entity { - export type Card = { - url: string; - title: string; - description: string; - type: "link" | "photo" | "video" | "rich"; - image?: string; - author_name?: string; - author_url?: string; - provider_name?: string; - provider_url?: string; - html?: string; - width?: number; - height?: number; - }; + export type Card = { + url: string + title: string + description: string + type: 'link' | 'photo' | 'video' | 'rich' + image: string | null + author_name: string | null + author_url: string | null + provider_name: string | null + provider_url: string | null + html: string | null + width: number | null + height: number | null + embed_url: string | null + blurhash: string | null + } } diff --git a/packages/megalodon/src/entities/context.ts b/packages/megalodon/src/entities/context.ts index a794a7c5a8..3f2eda58f7 100644 --- a/packages/megalodon/src/entities/context.ts +++ b/packages/megalodon/src/entities/context.ts @@ -1,8 +1,8 @@ /// namespace Entity { - export type Context = { - ancestors: Array; - descendants: Array; - }; + export type Context = { + ancestors: Array + descendants: Array + } } diff --git a/packages/megalodon/src/entities/conversation.ts b/packages/megalodon/src/entities/conversation.ts index 2bdc196661..cdadf1e0f2 100644 --- a/packages/megalodon/src/entities/conversation.ts +++ b/packages/megalodon/src/entities/conversation.ts @@ -2,10 +2,10 @@ /// namespace Entity { - export type Conversation = { - id: string; - accounts: Array; - last_status: Status | null; - unread: boolean; - }; + export type Conversation = { + id: string + accounts: Array + last_status: Status | null + unread: boolean + } } diff --git a/packages/megalodon/src/entities/emoji.ts b/packages/megalodon/src/entities/emoji.ts index 10c32ab0bd..546ef818f9 100644 --- a/packages/megalodon/src/entities/emoji.ts +++ b/packages/megalodon/src/entities/emoji.ts @@ -1,9 +1,9 @@ namespace Entity { - export type Emoji = { - shortcode: string; - static_url: string; - url: string; - visible_in_picker: boolean; - category: string; - }; + export type Emoji = { + shortcode: string + static_url: string + url: string + visible_in_picker: boolean + category?: string + } } diff --git a/packages/megalodon/src/entities/featured_tag.ts b/packages/megalodon/src/entities/featured_tag.ts index fc9f8c69cc..06ae6d7a9d 100644 --- a/packages/megalodon/src/entities/featured_tag.ts +++ b/packages/megalodon/src/entities/featured_tag.ts @@ -1,8 +1,8 @@ namespace Entity { - export type FeaturedTag = { - id: string; - name: string; - statuses_count: number; - last_status_at: string; - }; + export type FeaturedTag = { + id: string + name: string + statuses_count: number + last_status_at: string + } } diff --git a/packages/megalodon/src/entities/field.ts b/packages/megalodon/src/entities/field.ts index de4b6b2b72..03e4604b02 100644 --- a/packages/megalodon/src/entities/field.ts +++ b/packages/megalodon/src/entities/field.ts @@ -1,7 +1,7 @@ namespace Entity { - export type Field = { - name: string; - value: string; - verified_at: string | null; - }; + export type Field = { + name: string + value: string + verified_at: string | null + } } diff --git a/packages/megalodon/src/entities/filter.ts b/packages/megalodon/src/entities/filter.ts index 55b7305cc3..ffbacb7287 100644 --- a/packages/megalodon/src/entities/filter.ts +++ b/packages/megalodon/src/entities/filter.ts @@ -1,12 +1,12 @@ namespace Entity { - export type Filter = { - id: string; - phrase: string; - context: Array; - expires_at: string | null; - irreversible: boolean; - whole_word: boolean; - }; + export type Filter = { + id: string + phrase: string + context: Array + expires_at: string | null + irreversible: boolean + whole_word: boolean + } - export type FilterContext = string; + export type FilterContext = string } diff --git a/packages/megalodon/src/entities/follow_request.ts b/packages/megalodon/src/entities/follow_request.ts new file mode 100644 index 0000000000..84ea4d02c8 --- /dev/null +++ b/packages/megalodon/src/entities/follow_request.ts @@ -0,0 +1,27 @@ +/// +/// + +namespace Entity { + export type FollowRequest = { + id: number + username: string + acct: string + display_name: string + locked: boolean + bot: boolean + discoverable?: boolean + group: boolean + created_at: string + note: string + url: string + avatar: string + avatar_static: string + header: string + header_static: string + followers_count: number + following_count: number + statuses_count: number + emojis: Array + fields: Array + } +} diff --git a/packages/megalodon/src/entities/history.ts b/packages/megalodon/src/entities/history.ts index 4676357d69..0709694260 100644 --- a/packages/megalodon/src/entities/history.ts +++ b/packages/megalodon/src/entities/history.ts @@ -1,7 +1,7 @@ namespace Entity { - export type History = { - day: string; - uses: number; - accounts: number; - }; + export type History = { + day: string + uses: number + accounts: number + } } diff --git a/packages/megalodon/src/entities/identity_proof.ts b/packages/megalodon/src/entities/identity_proof.ts index 3b42e6f412..ff857addb0 100644 --- a/packages/megalodon/src/entities/identity_proof.ts +++ b/packages/megalodon/src/entities/identity_proof.ts @@ -1,9 +1,9 @@ namespace Entity { - export type IdentityProof = { - provider: string; - provider_username: string; - updated_at: string; - proof_url: string; - profile_url: string; - }; + export type IdentityProof = { + provider: string + provider_username: string + updated_at: string + proof_url: string + profile_url: string + } } diff --git a/packages/megalodon/src/entities/instance.ts b/packages/megalodon/src/entities/instance.ts index 9c0f572db4..8f4808be8f 100644 --- a/packages/megalodon/src/entities/instance.ts +++ b/packages/megalodon/src/entities/instance.ts @@ -3,39 +3,38 @@ /// namespace Entity { - export type Instance = { - uri: string; - title: string; - description: string; - email: string; - version: string; - thumbnail: string | null; - urls: URLs; - stats: Stats; - languages: Array; - contact_account: Account | null; - max_toot_chars?: number; - registrations?: boolean; - configuration?: { - statuses: { - max_characters: number; - max_media_attachments: number; - characters_reserved_per_url: number; - }; - media_attachments: { - supported_mime_types: Array; - image_size_limit: number; - image_matrix_limit: number; - video_size_limit: number; - video_frame_limit: number; - video_matrix_limit: number; - }; - polls: { - max_options: number; - max_characters_per_option: number; - min_expiration: number; - max_expiration: number; - }; - }; - }; + export type Instance = { + uri: string + title: string + description: string + email: string + version: string + thumbnail: string | null + urls: URLs | null + stats: Stats + languages: Array + registrations: boolean + approval_required: boolean + invites_enabled?: boolean + configuration: { + statuses: { + max_characters: number + max_media_attachments?: number + characters_reserved_per_url?: number + } + polls?: { + max_options: number + max_characters_per_option: number + min_expiration: number + max_expiration: number + } + } + contact_account?: Account + rules?: Array + } + + export type InstanceRule = { + id: string + text: string + } } diff --git a/packages/megalodon/src/entities/list.ts b/packages/megalodon/src/entities/list.ts index 97e75286b2..58c264abab 100644 --- a/packages/megalodon/src/entities/list.ts +++ b/packages/megalodon/src/entities/list.ts @@ -1,6 +1,9 @@ namespace Entity { - export type List = { - id: string; - title: string; - }; + export type List = { + id: string + title: string + replies_policy: RepliesPolicy | null + } + + export type RepliesPolicy = 'followed' | 'list' | 'none' } diff --git a/packages/megalodon/src/entities/marker.ts b/packages/megalodon/src/entities/marker.ts index 7ee99282ca..33cb98a10c 100644 --- a/packages/megalodon/src/entities/marker.ts +++ b/packages/megalodon/src/entities/marker.ts @@ -1,15 +1,15 @@ namespace Entity { - export type Marker = { - home?: { - last_read_id: string; - version: number; - updated_at: string; - }; - notifications?: { - last_read_id: string; - version: number; - updated_at: string; - unread_count?: number; - }; - }; + export type Marker = { + home?: { + last_read_id: string + version: number + updated_at: string + } + notifications?: { + last_read_id: string + version: number + updated_at: string + unread_count?: number + } + } } diff --git a/packages/megalodon/src/entities/mention.ts b/packages/megalodon/src/entities/mention.ts index 4fe36a6553..046912971c 100644 --- a/packages/megalodon/src/entities/mention.ts +++ b/packages/megalodon/src/entities/mention.ts @@ -1,8 +1,8 @@ namespace Entity { - export type Mention = { - id: string; - username: string; - url: string; - acct: string; - }; + export type Mention = { + id: string + username: string + url: string + acct: string + } } diff --git a/packages/megalodon/src/entities/notification.ts b/packages/megalodon/src/entities/notification.ts index 68eff3347e..653d235d99 100644 --- a/packages/megalodon/src/entities/notification.ts +++ b/packages/megalodon/src/entities/notification.ts @@ -2,14 +2,15 @@ /// namespace Entity { - export type Notification = { - account: Account; - created_at: string; - id: string; - status?: Status; - reaction?: Reaction; - type: NotificationType; - }; + export type Notification = { + account: Account + created_at: string + id: string + status?: Status + emoji?: string + type: NotificationType + target?: Account + } - export type NotificationType = string; + export type NotificationType = string } diff --git a/packages/megalodon/src/entities/poll.ts b/packages/megalodon/src/entities/poll.ts index 2539d68b20..69706e8ae1 100644 --- a/packages/megalodon/src/entities/poll.ts +++ b/packages/megalodon/src/entities/poll.ts @@ -1,14 +1,13 @@ /// namespace Entity { - export type Poll = { - id: string; - expires_at: string | null; - expired: boolean; - multiple: boolean; - votes_count: number; - options: Array; - voted: boolean; - own_votes: Array; - }; + export type Poll = { + id: string + expires_at: string | null + expired: boolean + multiple: boolean + votes_count: number + options: Array + voted: boolean + } } diff --git a/packages/megalodon/src/entities/poll_option.ts b/packages/megalodon/src/entities/poll_option.ts index e818a8607b..ae4c638498 100644 --- a/packages/megalodon/src/entities/poll_option.ts +++ b/packages/megalodon/src/entities/poll_option.ts @@ -1,6 +1,6 @@ namespace Entity { - export type PollOption = { - title: string; - votes_count: number | null; - }; + export type PollOption = { + title: string + votes_count: number | null + } } diff --git a/packages/megalodon/src/entities/preferences.ts b/packages/megalodon/src/entities/preferences.ts index 7994dc568e..cb5797c4ce 100644 --- a/packages/megalodon/src/entities/preferences.ts +++ b/packages/megalodon/src/entities/preferences.ts @@ -1,9 +1,9 @@ namespace Entity { - export type Preferences = { - "posting:default:visibility": "public" | "unlisted" | "private" | "direct"; - "posting:default:sensitive": boolean; - "posting:default:language": string | null; - "reading:expand:media": "default" | "show_all" | "hide_all"; - "reading:expand:spoilers": boolean; - }; + export type Preferences = { + 'posting:default:visibility': 'public' | 'unlisted' | 'private' | 'direct' + 'posting:default:sensitive': boolean + 'posting:default:language': string | null + 'reading:expand:media': 'default' | 'show_all' | 'hide_all' + 'reading:expand:spoilers': boolean + } } diff --git a/packages/megalodon/src/entities/push_subscription.ts b/packages/megalodon/src/entities/push_subscription.ts index ad1146a242..fe7464e8e2 100644 --- a/packages/megalodon/src/entities/push_subscription.ts +++ b/packages/megalodon/src/entities/push_subscription.ts @@ -1,16 +1,16 @@ namespace Entity { - export type Alerts = { - follow: boolean; - favourite: boolean; - mention: boolean; - reblog: boolean; - poll: boolean; - }; + export type Alerts = { + follow: boolean + favourite: boolean + mention: boolean + reblog: boolean + poll: boolean + } - export type PushSubscription = { - id: string; - endpoint: string; - server_key: string; - alerts: Alerts; - }; + export type PushSubscription = { + id: string + endpoint: string + server_key: string + alerts: Alerts + } } diff --git a/packages/megalodon/src/entities/reaction.ts b/packages/megalodon/src/entities/reaction.ts index 4edbec6a7d..8c626f9e84 100644 --- a/packages/megalodon/src/entities/reaction.ts +++ b/packages/megalodon/src/entities/reaction.ts @@ -1,12 +1,10 @@ /// namespace Entity { - export type Reaction = { - count: number; - me: boolean; - name: string; - url?: string; - static_url?: string; - accounts?: Array; - }; + export type Reaction = { + count: number + me: boolean + name: string + accounts?: Array + } } diff --git a/packages/megalodon/src/entities/relationship.ts b/packages/megalodon/src/entities/relationship.ts index 91802d5c88..283a1158c6 100644 --- a/packages/megalodon/src/entities/relationship.ts +++ b/packages/megalodon/src/entities/relationship.ts @@ -1,17 +1,17 @@ namespace Entity { - export type Relationship = { - id: string; - following: boolean; - followed_by: boolean; - delivery_following?: boolean; - blocking: boolean; - blocked_by: boolean; - muting: boolean; - muting_notifications: boolean; - requested: boolean; - domain_blocking: boolean; - showing_reblogs: boolean; - endorsed: boolean; - notifying: boolean; - }; + export type Relationship = { + id: string + following: boolean + followed_by: boolean + blocking: boolean + blocked_by: boolean + muting: boolean + muting_notifications: boolean + requested: boolean + domain_blocking: boolean + showing_reblogs: boolean + endorsed: boolean + notifying: boolean + note: string | null + } } diff --git a/packages/megalodon/src/entities/report.ts b/packages/megalodon/src/entities/report.ts index 6862a5fabe..353886a344 100644 --- a/packages/megalodon/src/entities/report.ts +++ b/packages/megalodon/src/entities/report.ts @@ -1,9 +1,18 @@ +/// + namespace Entity { - export type Report = { - id: string; - action_taken: string; - comment: string; - account_id: string; - status_ids: Array; - }; + export type Report = { + id: string + action_taken: boolean + action_taken_at: string | null + status_ids: Array | null + rule_ids: Array | null + // These parameters don't exist in Pleroma + category: Category | null + comment: string | null + forwarded: boolean | null + target_account?: Account | null + } + + export type Category = 'spam' | 'violation' | 'other' } diff --git a/packages/megalodon/src/entities/results.ts b/packages/megalodon/src/entities/results.ts index 4448e53350..fe168de67b 100644 --- a/packages/megalodon/src/entities/results.ts +++ b/packages/megalodon/src/entities/results.ts @@ -3,9 +3,9 @@ /// namespace Entity { - export type Results = { - accounts: Array; - statuses: Array; - hashtags: Array; - }; + export type Results = { + accounts: Array + statuses: Array + hashtags: Array + } } diff --git a/packages/megalodon/src/entities/role.ts b/packages/megalodon/src/entities/role.ts new file mode 100644 index 0000000000..caaae9ea12 --- /dev/null +++ b/packages/megalodon/src/entities/role.ts @@ -0,0 +1,5 @@ +namespace Entity { + export type Role = { + name: string + } +} diff --git a/packages/megalodon/src/entities/scheduled_status.ts b/packages/megalodon/src/entities/scheduled_status.ts index 78dfb8ed26..561a5b9f2c 100644 --- a/packages/megalodon/src/entities/scheduled_status.ts +++ b/packages/megalodon/src/entities/scheduled_status.ts @@ -1,10 +1,10 @@ /// /// namespace Entity { - export type ScheduledStatus = { - id: string; - scheduled_at: string; - params: StatusParams; - media_attachments: Array; - }; + export type ScheduledStatus = { + id: string + scheduled_at: string + params: StatusParams + media_attachments: Array | null + } } diff --git a/packages/megalodon/src/entities/source.ts b/packages/megalodon/src/entities/source.ts index 913b02fda7..d87cf55d85 100644 --- a/packages/megalodon/src/entities/source.ts +++ b/packages/megalodon/src/entities/source.ts @@ -1,10 +1,10 @@ /// namespace Entity { - export type Source = { - privacy: string | null; - sensitive: boolean | null; - language: string | null; - note: string; - fields: Array; - }; + export type Source = { + privacy: string | null + sensitive: boolean | null + language: string | null + note: string + fields: Array + } } diff --git a/packages/megalodon/src/entities/stats.ts b/packages/megalodon/src/entities/stats.ts index 6471df039a..76f0bad34c 100644 --- a/packages/megalodon/src/entities/stats.ts +++ b/packages/megalodon/src/entities/stats.ts @@ -1,7 +1,7 @@ namespace Entity { - export type Stats = { - user_count: number; - status_count: number; - domain_count: number; - }; + export type Stats = { + user_count: number + status_count: number + domain_count: number + } } diff --git a/packages/megalodon/src/entities/status.ts b/packages/megalodon/src/entities/status.ts index f27f728b54..295703e57c 100644 --- a/packages/megalodon/src/entities/status.ts +++ b/packages/megalodon/src/entities/status.ts @@ -1,7 +1,6 @@ /// /// /// -/// /// /// /// @@ -9,37 +8,42 @@ /// namespace Entity { - export type Status = { - id: string; - uri: string; - url: string; - account: Account; - in_reply_to_id: string | null; - in_reply_to_account_id: string | null; - reblog: Status | null; - content: string; - plain_content: string | null; - created_at: string; - emojis: Emoji[]; - replies_count: number; - reblogs_count: number; - favourites_count: number; - reblogged: boolean | null; - favourited: boolean | null; - muted: boolean | null; - sensitive: boolean; - spoiler_text: string; - visibility: "public" | "unlisted" | "private" | "direct"; - media_attachments: Array; - mentions: Array; - tags: Array; - card: Card | null; - poll: Poll | null; - application: Application | null; - language: string | null; - pinned: boolean | null; - reactions: Array; - quote: Status | null; - bookmarked: boolean; - }; + export type Status = { + id: string + uri: string + url: string + account: Account + in_reply_to_id: string | null + in_reply_to_account_id: string | null + reblog: Status | null + content: string + plain_content: string | null + created_at: string + emojis: Emoji[] + replies_count: number + reblogs_count: number + favourites_count: number + reblogged: boolean | null + favourited: boolean | null + muted: boolean | null + sensitive: boolean + spoiler_text: string + visibility: 'public' | 'unlisted' | 'private' | 'direct' + media_attachments: Array + mentions: Array + tags: Array + card: Card | null + poll: Poll | null + application: Application | null + language: string | null + pinned: boolean | null + emoji_reactions: Array + quote: boolean + bookmarked: boolean + } + + export type StatusTag = { + name: string + url: string + } } diff --git a/packages/megalodon/src/entities/status_params.ts b/packages/megalodon/src/entities/status_params.ts index 18908c01c1..82d7890868 100644 --- a/packages/megalodon/src/entities/status_params.ts +++ b/packages/megalodon/src/entities/status_params.ts @@ -1,12 +1,12 @@ namespace Entity { - export type StatusParams = { - text: string; - in_reply_to_id: string | null; - media_ids: Array | null; - sensitive: boolean | null; - spoiler_text: string | null; - visibility: "public" | "unlisted" | "private" | "direct"; - scheduled_at: string | null; - application_id: string; - }; + export type StatusParams = { + text: string + in_reply_to_id: string | null + media_ids: Array | null + sensitive: boolean | null + spoiler_text: string | null + visibility: 'public' | 'unlisted' | 'private' | 'direct' | null + scheduled_at: string | null + application_id: number | null + } } diff --git a/packages/megalodon/src/entities/status_source.ts b/packages/megalodon/src/entities/status_source.ts new file mode 100644 index 0000000000..0de7030ed5 --- /dev/null +++ b/packages/megalodon/src/entities/status_source.ts @@ -0,0 +1,7 @@ +namespace Entity { + export type StatusSource = { + id: string + text: string + spoiler_text: string + } +} diff --git a/packages/megalodon/src/entities/tag.ts b/packages/megalodon/src/entities/tag.ts index ccc88aece6..ddc5fe92be 100644 --- a/packages/megalodon/src/entities/tag.ts +++ b/packages/megalodon/src/entities/tag.ts @@ -1,10 +1,10 @@ /// namespace Entity { - export type Tag = { - name: string; - url: string; - history: Array | null; - following?: boolean; - }; + export type Tag = { + name: string + url: string + history: Array + following?: boolean + } } diff --git a/packages/megalodon/src/entities/token.ts b/packages/megalodon/src/entities/token.ts index 1583edafb1..6fa28e39b5 100644 --- a/packages/megalodon/src/entities/token.ts +++ b/packages/megalodon/src/entities/token.ts @@ -1,8 +1,8 @@ namespace Entity { - export type Token = { - access_token: string; - token_type: string; - scope: string; - created_at: number; - }; + export type Token = { + access_token: string + token_type: string + scope: string + created_at: number + } } diff --git a/packages/megalodon/src/entities/urls.ts b/packages/megalodon/src/entities/urls.ts index 1ee9ed67c9..4a980d589d 100644 --- a/packages/megalodon/src/entities/urls.ts +++ b/packages/megalodon/src/entities/urls.ts @@ -1,5 +1,5 @@ namespace Entity { - export type URLs = { - streaming_api: string; - }; + export type URLs = { + streaming_api: string + } } -- cgit v1.2.3-freya