]> Untitled Git - lemmy.git/blobdiff - ui/src/interfaces.ts
Merge branch 'dev' into federation
[lemmy.git] / ui / src / interfaces.ts
index 5baadb170d1231ca5bf15bd3a17dd90d262e2450..12430836c45d1b0ad9f95f550bdc4a6d1ea2e210 100644 (file)
@@ -43,6 +43,8 @@ export enum UserOperation {
   GetPrivateMessages,
   UserJoin,
   GetComments,
+  GetSiteConfig,
+  SaveSiteConfig,
 }
 
 export enum CommentSortType {
@@ -98,11 +100,13 @@ export interface User {
 
 export interface UserView {
   id: number;
+  actor_id: string;
   name: string;
   avatar?: string;
   email?: string;
   matrix_user_id?: string;
-  fedi_name: string;
+  bio?: string;
+  local: boolean;
   published: string;
   number_of_posts: number;
   post_score: number;
@@ -116,15 +120,21 @@ export interface UserView {
 export interface CommunityUser {
   id: number;
   user_id: number;
+  user_actor_id: string;
+  user_local: boolean;
   user_name: string;
   avatar?: string;
   community_id: number;
+  community_actor_id: string;
+  community_local: boolean;
   community_name: string;
   published: string;
 }
 
 export interface Community {
   id: number;
+  actor_id: string;
+  local: boolean;
   name: string;
   title: string;
   description?: string;
@@ -135,6 +145,9 @@ export interface Community {
   nsfw: boolean;
   published: string;
   updated?: string;
+  creator_actor_id: string;
+  creator_local: boolean;
+  last_refreshed_at: string;
   creator_name: string;
   creator_avatar?: string;
   category_name: string;
@@ -156,13 +169,23 @@ export interface Post {
   deleted: boolean;
   locked: boolean;
   stickied: boolean;
+  embed_title?: string;
+  embed_description?: string;
+  embed_html?: string;
+  thumbnail_url?: string;
+  ap_id: string;
+  local: boolean;
   nsfw: boolean;
   banned: boolean;
   banned_from_community: boolean;
   published: string;
   updated?: string;
+  creator_actor_id: string;
+  creator_local: boolean;
   creator_name: string;
   creator_avatar?: string;
+  community_actor_id: string;
+  community_local: boolean;
   community_name: string;
   community_removed: boolean;
   community_deleted: boolean;
@@ -183,6 +206,8 @@ export interface Post {
 
 export interface Comment {
   id: number;
+  ap_id: string;
+  local: boolean;
   creator_id: number;
   post_id: number;
   parent_id?: number;
@@ -193,9 +218,13 @@ export interface Comment {
   published: string;
   updated?: string;
   community_id: number;
+  community_actor_id: string;
+  community_local: boolean;
   community_name: string;
   banned: boolean;
   banned_from_community: boolean;
+  creator_actor_id: string;
+  creator_local: boolean;
   creator_name: string;
   creator_avatar?: string;
   score: number;
@@ -208,6 +237,9 @@ export interface Comment {
   saved?: boolean;
   user_mention_id?: number; // For mention type
   recipient_id?: number;
+  recipient_actor_id?: string;
+  recipient_local?: boolean;
+  depth?: number;
 }
 
 export interface Category {
@@ -694,6 +726,19 @@ export interface SiteForm {
   auth?: string;
 }
 
+export interface GetSiteConfig {
+  auth?: string;
+}
+
+export interface GetSiteConfigResponse {
+  config_hjson: string;
+}
+
+export interface SiteConfigForm {
+  config_hjson: string;
+  auth?: string;
+}
+
 export interface GetSiteResponse {
   site: Site;
   admins: Array<UserView>;
@@ -841,7 +886,8 @@ export type MessageType =
   | PasswordChangeForm
   | PrivateMessageForm
   | EditPrivateMessageForm
-  | GetPrivateMessagesForm;
+  | GetPrivateMessagesForm
+  | SiteConfigForm;
 
 type ResponseType =
   | SiteResponse
@@ -863,7 +909,8 @@ type ResponseType =
   | BanUserResponse
   | AddAdminResponse
   | PrivateMessageResponse
-  | PrivateMessagesResponse;
+  | PrivateMessagesResponse
+  | GetSiteConfigResponse;
 
 export interface WebSocketResponse {
   op: UserOperation;
@@ -876,18 +923,3 @@ export interface WebSocketJsonResponse {
   error?: string;
   reconnect?: boolean;
 }
-
-export interface FramelyData {
-  url: string;
-  type: string;
-  version?: string;
-  title: string;
-  author?: string;
-  author_url?: string;
-  provider_name?: string;
-  thumbnail_url?: string;
-  thumbnail_width?: number;
-  thumbnail_height?: number;
-  description?: string;
-  html?: string;
-}