WIP: Rearrange code
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
export interface BookMetadataBI {
|
||||
bookId: number;
|
||||
title: string;
|
||||
subtitle?: string;
|
||||
authors: Array<string>;
|
||||
categories: Array<string>;
|
||||
publisher: string;
|
||||
publishedDate: string;
|
||||
isbn10: string;
|
||||
isbn13: string;
|
||||
rating?: number | null;
|
||||
reviewCount?: number | null;
|
||||
description?: string;
|
||||
pageCount?: number | null;
|
||||
language: string;
|
||||
googleBookId?: string;
|
||||
thumbnailUrl?: string;
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
import { Book } from './book.model';
|
||||
|
||||
export interface BookNotification {
|
||||
action: Action;
|
||||
addedBook?: Book;
|
||||
removedBookIds?: Set<number>;
|
||||
}
|
||||
|
||||
export enum Action {
|
||||
BOOK_ADDED = 'BOOK_ADDED',
|
||||
BOOKS_REMOVED = 'BOOKS_REMOVED',
|
||||
}
|
||||
|
||||
export function parseBookNotification(messageBody: string): BookNotification {
|
||||
const raw = JSON.parse(messageBody);
|
||||
return {
|
||||
action: raw.action,
|
||||
addedBook: raw.addedBook,
|
||||
removedBookIds: raw.removedBookIds ? new Set<number>(raw.removedBookIds) : undefined,
|
||||
};
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
export interface LogNotification {
|
||||
timestamp?: string;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export function parseLogNotification(messageBody: string): LogNotification {
|
||||
const raw = JSON.parse(messageBody);
|
||||
const localTime = new Date(raw.timestamp).toLocaleTimeString();
|
||||
|
||||
return {
|
||||
timestamp: localTime,
|
||||
message: raw.message,
|
||||
};
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
export enum MetadataProvider {
|
||||
Amazon = "Amazon",
|
||||
Google = "Google",
|
||||
GoodReads = "GoodReads"
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
export interface AppState {
|
||||
preset?: string;
|
||||
primary?: string;
|
||||
surface?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user