1// Post comments over REST — the twin of app/wix/blog/comments.ts. Same exports, same DTOs; the2// rules and mappers come from comments-core (the SAME file the SDK transport uses, deployed flat3// next to this one). Every call runs as the calling identity — in a port, the viewer's session4// token, never a process-wide one (a create would be attributed to whoever that token is).5// docs: https://dev.wix.com/docs/api-reference/crm/community/comments/comments/list-comments-by-resource.md6// docs: https://dev.wix.com/docs/api-reference/crm/community/comments/comments/create-comment.md7// docs: https://dev.wix.com/docs/api-reference/crm/community/comments/comments/delete-comment.md8import { wixRequest } from "../../shared/rest/client.js";9import { fetchAuthorsByIds } from "./authors.js";10import {
22import type { Raw } from "../app/wix/blog/posts-core.js";
23import type { BlogComment, CommentPage, CommentThread } from "../app/wix/blog/types.js";
24
25export { type CreateCommentOptions, type ListCommentsOptions };
26
27const COMMENTS = "/comments/v1/comments";
28
29/**
30 * One page of top-level comments plus each one's reply seam (cursor, no replies yet).
31 * GET /comments/v1/comments/list-by-resource?appId=&contextId=&resourceId=&commentSort.order=&replySort.order=OLDEST_FIRST&cursorPaging.limit=10&cursorPaging.repliesLimit=0[&cursorPaging.cursor=]