@wepublish/api
Version:
API core for we.publish.
66 lines (65 loc) • 2.64 kB
TypeScript
import { Comment, CommentRating, CommentRatingSystemAnswer, CommentState, CommentsRevisions, PrismaClient } from '@prisma/client';
import { Context } from '../../context';
import { CalculatedRating, PublicCommentSort } from '../../db/comment';
import { SortOrder } from "../../../../utils-api/src";
export declare const mapCommentToPublicComment: (comment: Comment & {
revisions: CommentsRevisions[];
}) => {
id: string;
createdAt: Date;
modifiedAt: Date;
userID: string;
source: string;
state: CommentState;
itemID: string;
itemType: import(".prisma/client").CommentItemType;
peerId: string;
parentID: string;
rejectionReason: import(".prisma/client").CommentRejectionReason;
authorType: import(".prisma/client").CommentAuthorType;
guestUsername: string;
guestUserImageID: string;
revisions: CommentsRevisions[];
title: string;
lead: string;
text: import(".prisma/client").Prisma.JsonValue;
};
export declare const getPublicChildrenCommentsByParentId: (parentId: string, userId: string | null, comment: PrismaClient['comment']) => Promise<{
id: string;
createdAt: Date;
modifiedAt: Date;
userID: string;
source: string;
state: CommentState;
itemID: string;
itemType: import(".prisma/client").CommentItemType;
peerId: string;
parentID: string;
rejectionReason: import(".prisma/client").CommentRejectionReason;
authorType: import(".prisma/client").CommentAuthorType;
guestUsername: string;
guestUserImageID: string;
revisions: CommentsRevisions[];
title: string;
lead: string;
text: import(".prisma/client").Prisma.JsonValue;
}[]>;
export declare const getCalculatedRatingsForComment: (answers: CommentRatingSystemAnswer[], ratings: CommentRating[]) => CalculatedRating[];
export declare const getPublicCommentsForItemById: (itemId: string, userId: string | null, sort: PublicCommentSort | null, order: SortOrder, commentRatingSystemAnswers: Context['loaders']['commentRatingSystemAnswers'], comment: PrismaClient['comment']) => Promise<(import("@prisma/client/runtime/library").GetResult<{
id: string;
createdAt: Date;
modifiedAt: Date;
itemID: string;
itemType: import(".prisma/client").CommentItemType;
peerId: string;
parentID: string;
rejectionReason: import(".prisma/client").CommentRejectionReason;
state: CommentState;
source: string;
authorType: import(".prisma/client").CommentAuthorType;
guestUsername: string;
guestUserImageID: string;
userID: string;
}, unknown> & {} & {
calculatedRatings: CalculatedRating[];
})[]>;