astro-loader-goodreads
Version:
Load data from Goodreads in Astro
437 lines (436 loc) • 12 kB
TypeScript
import { z } from 'astro/zod';
/**
* Fields are present with the same names as in Goodreads RSS feeds.
*/
export declare const BookSchema: z.ZodObject<{
id: z.ZodString;
title: z.ZodString;
guid: z.ZodString;
pubDate: z.ZodString;
link: z.ZodString;
book_id: z.ZodString;
book_image_url: z.ZodString;
book_small_image_url: z.ZodString;
book_medium_image_url: z.ZodString;
book_large_image_url: z.ZodString;
book_description: z.ZodString;
num_pages: z.ZodOptional<z.ZodString>;
author_name: z.ZodString;
isbn: z.ZodString;
user_name: z.ZodString;
user_rating: z.ZodNumber;
user_read_at: z.ZodString;
user_date_added: z.ZodString;
user_date_created: z.ZodString;
user_shelves: z.ZodOptional<z.ZodString>;
user_review: z.ZodOptional<z.ZodString>;
average_rating: z.ZodNumber;
book_published: z.ZodString;
}, "strip", z.ZodTypeAny, {
id?: string;
title?: string;
guid?: string;
pubDate?: string;
link?: string;
book_id?: string;
book_image_url?: string;
book_small_image_url?: string;
book_medium_image_url?: string;
book_large_image_url?: string;
book_description?: string;
num_pages?: string;
author_name?: string;
isbn?: string;
user_name?: string;
user_rating?: number;
user_read_at?: string;
user_date_added?: string;
user_date_created?: string;
user_shelves?: string;
user_review?: string;
average_rating?: number;
book_published?: string;
}, {
id?: string;
title?: string;
guid?: string;
pubDate?: string;
link?: string;
book_id?: string;
book_image_url?: string;
book_small_image_url?: string;
book_medium_image_url?: string;
book_large_image_url?: string;
book_description?: string;
num_pages?: string;
author_name?: string;
isbn?: string;
user_name?: string;
user_rating?: number;
user_read_at?: string;
user_date_added?: string;
user_date_created?: string;
user_shelves?: string;
user_review?: string;
average_rating?: number;
book_published?: string;
}>;
export type Book = z.infer<typeof BookSchema>;
/**
* Fields are present with the same names as in Goodreads author blog RSS feeds.
*/
export declare const AuthorBlogSchema: z.ZodObject<{
id: z.ZodString;
title: z.ZodString;
link: z.ZodString;
description: z.ZodString;
pubDate: z.ZodString;
author: z.ZodOptional<z.ZodString>;
content: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
id?: string;
title?: string;
pubDate?: string;
link?: string;
description?: string;
author?: string;
content?: string;
}, {
id?: string;
title?: string;
pubDate?: string;
link?: string;
description?: string;
author?: string;
content?: string;
}>;
export type AuthorBlog = z.infer<typeof AuthorBlogSchema>;
/**
* Fields are present with the same names as in Goodreads user updates RSS feeds.
*/
export declare const UserUpdateSchema: z.ZodObject<{
id: z.ZodString;
title: z.ZodString;
link: z.ZodOptional<z.ZodString>;
description: z.ZodOptional<z.ZodString>;
pubDate: z.ZodString;
itemType: z.ZodOptional<z.ZodString>;
itemData: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
type: z.ZodLiteral<"AuthorFollowing">;
followId: z.ZodString;
userUrl: z.ZodString;
authorId: z.ZodString;
}, "strip", z.ZodTypeAny, {
type?: "AuthorFollowing";
followId?: string;
userUrl?: string;
authorId?: string;
}, {
type?: "AuthorFollowing";
followId?: string;
userUrl?: string;
authorId?: string;
}>, z.ZodObject<{
type: z.ZodLiteral<"UserStatus">;
userUrl: z.ZodString;
percentRead: z.ZodString;
bookUrl: z.ZodString;
bookTitle: z.ZodString;
bookAuthor: z.ZodString;
bookImgUrl: z.ZodString;
}, "strip", z.ZodTypeAny, {
type?: "UserStatus";
userUrl?: string;
percentRead?: string;
bookUrl?: string;
bookTitle?: string;
bookAuthor?: string;
bookImgUrl?: string;
}, {
type?: "UserStatus";
userUrl?: string;
percentRead?: string;
bookUrl?: string;
bookTitle?: string;
bookAuthor?: string;
bookImgUrl?: string;
}>, z.ZodObject<{
type: z.ZodLiteral<"ReadStatus">;
userUrl: z.ZodString;
readingStatus: z.ZodString;
bookUrl: z.ZodString;
bookTitle: z.ZodString;
bookAuthor: z.ZodString;
bookImgUrl: z.ZodString;
}, "strip", z.ZodTypeAny, {
type?: "ReadStatus";
userUrl?: string;
bookUrl?: string;
bookTitle?: string;
bookAuthor?: string;
bookImgUrl?: string;
readingStatus?: string;
}, {
type?: "ReadStatus";
userUrl?: string;
bookUrl?: string;
bookTitle?: string;
bookAuthor?: string;
bookImgUrl?: string;
readingStatus?: string;
}>, z.ZodObject<{
type: z.ZodLiteral<"Review">;
userUrl: z.ZodString;
rating: z.ZodNumber;
bookUrl: z.ZodString;
bookTitle: z.ZodString;
bookAuthor: z.ZodString;
bookImgUrl: z.ZodString;
}, "strip", z.ZodTypeAny, {
type?: "Review";
userUrl?: string;
bookUrl?: string;
bookTitle?: string;
bookAuthor?: string;
bookImgUrl?: string;
rating?: number;
}, {
type?: "Review";
userUrl?: string;
bookUrl?: string;
bookTitle?: string;
bookAuthor?: string;
bookImgUrl?: string;
rating?: number;
}>, z.ZodObject<{
type: z.ZodLiteral<"LikeReview">;
userUrl: z.ZodString;
reviewUrl: z.ZodString;
reviewUser: z.ZodString;
bookUrl: z.ZodString;
bookTitle: z.ZodString;
bookImgUrl: z.ZodString;
}, "strip", z.ZodTypeAny, {
type?: "LikeReview";
userUrl?: string;
bookUrl?: string;
bookTitle?: string;
bookImgUrl?: string;
reviewUrl?: string;
reviewUser?: string;
}, {
type?: "LikeReview";
userUrl?: string;
bookUrl?: string;
bookTitle?: string;
bookImgUrl?: string;
reviewUrl?: string;
reviewUser?: string;
}>, z.ZodObject<{
type: z.ZodLiteral<"LikeReadStatus">;
userUrl: z.ZodString;
readStatusUser: z.ZodString;
readStatusUserImgUrl: z.ZodString;
readStatus: z.ZodString;
bookUrl: z.ZodString;
bookTitle: z.ZodString;
}, "strip", z.ZodTypeAny, {
type?: "LikeReadStatus";
userUrl?: string;
bookUrl?: string;
bookTitle?: string;
readStatusUser?: string;
readStatusUserImgUrl?: string;
readStatus?: string;
}, {
type?: "LikeReadStatus";
userUrl?: string;
bookUrl?: string;
bookTitle?: string;
readStatusUser?: string;
readStatusUserImgUrl?: string;
readStatus?: string;
}>, z.ZodObject<{
type: z.ZodLiteral<"CommentStatus">;
userUrl: z.ZodString;
statusUrl: z.ZodString;
statusUser: z.ZodString;
comment: z.ZodString;
}, "strip", z.ZodTypeAny, {
type?: "CommentStatus";
userUrl?: string;
statusUrl?: string;
statusUser?: string;
comment?: string;
}, {
type?: "CommentStatus";
userUrl?: string;
statusUrl?: string;
statusUser?: string;
comment?: string;
}>, z.ZodObject<{
type: z.ZodLiteral<"CommentReview">;
userUrl: z.ZodString;
reviewUrl: z.ZodString;
reviewUser: z.ZodString;
bookUrl: z.ZodString;
bookTitle: z.ZodString;
bookAuthor: z.ZodString;
comment: z.ZodString;
}, "strip", z.ZodTypeAny, {
type?: "CommentReview";
userUrl?: string;
bookUrl?: string;
bookTitle?: string;
bookAuthor?: string;
reviewUrl?: string;
reviewUser?: string;
comment?: string;
}, {
type?: "CommentReview";
userUrl?: string;
bookUrl?: string;
bookTitle?: string;
bookAuthor?: string;
reviewUrl?: string;
reviewUser?: string;
comment?: string;
}>]>>;
}, "strip", z.ZodTypeAny, {
id?: string;
title?: string;
pubDate?: string;
link?: string;
description?: string;
itemType?: string;
itemData?: {
type?: "AuthorFollowing";
followId?: string;
userUrl?: string;
authorId?: string;
} | {
type?: "UserStatus";
userUrl?: string;
percentRead?: string;
bookUrl?: string;
bookTitle?: string;
bookAuthor?: string;
bookImgUrl?: string;
} | {
type?: "ReadStatus";
userUrl?: string;
bookUrl?: string;
bookTitle?: string;
bookAuthor?: string;
bookImgUrl?: string;
readingStatus?: string;
} | {
type?: "Review";
userUrl?: string;
bookUrl?: string;
bookTitle?: string;
bookAuthor?: string;
bookImgUrl?: string;
rating?: number;
} | {
type?: "LikeReview";
userUrl?: string;
bookUrl?: string;
bookTitle?: string;
bookImgUrl?: string;
reviewUrl?: string;
reviewUser?: string;
} | {
type?: "LikeReadStatus";
userUrl?: string;
bookUrl?: string;
bookTitle?: string;
readStatusUser?: string;
readStatusUserImgUrl?: string;
readStatus?: string;
} | {
type?: "CommentStatus";
userUrl?: string;
statusUrl?: string;
statusUser?: string;
comment?: string;
} | {
type?: "CommentReview";
userUrl?: string;
bookUrl?: string;
bookTitle?: string;
bookAuthor?: string;
reviewUrl?: string;
reviewUser?: string;
comment?: string;
};
}, {
id?: string;
title?: string;
pubDate?: string;
link?: string;
description?: string;
itemType?: string;
itemData?: {
type?: "AuthorFollowing";
followId?: string;
userUrl?: string;
authorId?: string;
} | {
type?: "UserStatus";
userUrl?: string;
percentRead?: string;
bookUrl?: string;
bookTitle?: string;
bookAuthor?: string;
bookImgUrl?: string;
} | {
type?: "ReadStatus";
userUrl?: string;
bookUrl?: string;
bookTitle?: string;
bookAuthor?: string;
bookImgUrl?: string;
readingStatus?: string;
} | {
type?: "Review";
userUrl?: string;
bookUrl?: string;
bookTitle?: string;
bookAuthor?: string;
bookImgUrl?: string;
rating?: number;
} | {
type?: "LikeReview";
userUrl?: string;
bookUrl?: string;
bookTitle?: string;
bookImgUrl?: string;
reviewUrl?: string;
reviewUser?: string;
} | {
type?: "LikeReadStatus";
userUrl?: string;
bookUrl?: string;
bookTitle?: string;
readStatusUser?: string;
readStatusUserImgUrl?: string;
readStatus?: string;
} | {
type?: "CommentStatus";
userUrl?: string;
statusUrl?: string;
statusUser?: string;
comment?: string;
} | {
type?: "CommentReview";
userUrl?: string;
bookUrl?: string;
bookTitle?: string;
bookAuthor?: string;
reviewUrl?: string;
reviewUser?: string;
comment?: string;
};
}>;
export type UserUpdate = z.infer<typeof UserUpdateSchema>;