From cc5c45cf4368ac07042145ce0e5c369496dc1dc5 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Fri, 22 Jul 2022 12:07:34 +0200 Subject: [PATCH] Update issue types Signed-off-by: Sebastian Martinez --- src/issue.ts | 42 ++++++++++++++---------------------------- 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/src/issue.ts b/src/issue.ts index e62da68c0..c5475068b 100644 --- a/src/issue.ts +++ b/src/issue.ts @@ -1,13 +1,19 @@ import { type Host, Request } from '@app/api'; -import type { PeerId } from '@app/project'; +import type { Author } from '@app/cobs'; + +export interface TimelineItem { + person: Author; + message: string; + timestamp: number; +} export interface IIssue { id: string; author: Author; title: string; state: State; - comment: CommentWithReplies; - discussion: CommentWithReplies[]; + comment: Comment; + discussion: Thread[]; labels?: Label[]; // When no labels are set, this is undefined timestamp: number; } @@ -19,35 +25,15 @@ export type State = { reason: string; }; -export interface Comment { +export interface Comment { author: Author; body: string; reactions: Record; timestamp: number; + replies: R; } -export type Author = ResolvedIdentity | UnresolvedIdentity; - -export interface ResolvedIdentity { - kind: "resolved"; - peer: PeerId; - identity: { - urn: string; - name: string; - ens: { - name: string; - } | null; - }; -} -export interface UnresolvedIdentity { - kind: "unresolved"; - peer: PeerId; - urn: string; -} - -export interface CommentWithReplies extends Comment { - replies: Comment[]; -} +export type Thread = Comment; export type Label = string; @@ -63,8 +49,8 @@ export class Issue { author: Author; title: string; state: State; - comment: CommentWithReplies; - discussion: CommentWithReplies[]; + comment: Comment; + discussion: Thread[]; labels?: Label[]; // When no labels are set, this is undefined timestamp: number;