blob: 436b7e37f2a815e391aea12b5fabc740c39f2c40 [file] [log] [blame]
j7940eec2020-12-28 14:00:41 -06001/**
2 * @file DTPS pages & discussion functions
3 * @author jottocraft
4 *
j6e1a7bf2026-10-13 03:37:04 +00005 * @copyright Copyright (c) jottocraft 2020
j40db0272022-01-14 15:18:29 -08006 * @license MIT
j7940eec2020-12-28 14:00:41 -06007 */
8
9
10/**
11 * Renders the discussions list for a class
12 *
13 * @param {string} courseID The course ID to render discussion threads for
14 * @param {string} [defaultThread] The thread to load by default
15 * @param {boolean} [fromModules] True if this page is being loaded from the moduleStream
16 * @param {string} [defaultPost] The post to load by default
17 */
18dtps.loadThreadsList = function (courseID, defaultThread, fromModules, defaultPost) {
19 //Get class index and set as selected class
20 var classNum = dtps.classes.map(course => course.id).indexOf(courseID);
21 dtps.selectedClass = classNum;
22
23 //Set discussions as the selected content
24 if (!fromModules) {
25 dtps.selectedContent = "discuss";
26 $("#dtpsTabBar .btn").removeClass("active");
27 $("#dtpsTabBar .btn.discuss").addClass("active");
28 jQuery("body").removeClass("collapsedSidebar");
29 }
30
31 if (classNum == -1) {
32 //Class does not exist
33 dtps.error("The selected class doesn't exist", "classNum check failed @ dtps.loadThreadsList");
34 }
35
36 //Load class color and things
37 dtps.presentClass(classNum);
38
39 //Load module thread
40 if (fromModules) {
41 dtps.loadThreadPosts(classNum, defaultThread, fromModules, defaultPost);
42 return;
43 }
44
45 if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "discuss")) {
46 //Render sidebar
47 jQuery(".sidebar").html(/*html*/`
48 <div class="title">
49 <i style="font-size: 28px; margin-right: 7px; vertical-align: middle;" class="fluid-icon">forum</i>
50 <h4>Discussions</h4>
51 </div>
52
53 <div class="items">
54 <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="item main back">
55 <i class="fluid-icon">keyboard_arrow_left</i> <span class="label">Classes</span>
56 </div>
57
58 <div class="divider"></div>
59
60 <div class="item shimmerParent">
61 <i class="fluid-icon">star</i>
62 <span class="label">Discussion thread Title</span>
63 </div>
64 <div class="item shimmerParent">
65 <i class="fluid-icon">star</i>
66 <span class="label">Discussion thread Title</span>
67 </div>
68 <div class="item shimmerParent">
69 <i class="fluid-icon">star</i>
70 <span class="label">Discussion thread Title</span>
71 </div>
72 </div>
73 `);
74
75 //Delete existing class content HTML
76 jQuery(".classContent").html("");
77 }
78
79 //Fetch discussion thread data
80 dtpsLMS.fetchDiscussionThreads(dtps.classes[classNum].lmsID).then(function (threadData) {
81 //Store fetched data to the selected class
82 dtps.classes[classNum].discussions = threadData;
83
84 if (dtps.classes[classNum].discussions.length == 0) {
85 //No discussion topics in this class
86 jQuery(".sidebar .items").html(/*html*/`
87 <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="item main back">
88 <i class="fluid-icon">keyboard_arrow_left</i> <span class="label">Classes</span>
89 </div>
90
91 <p style="text-align: center; font-weight: bold; margin-top: 60px; margin-bottom: 10px;">No discussions found</p>
92 <p style="text-align: center; font-size: 14px; margin: 0px;">This class doesn't have any discussions</p>
93 `);
94 } else {
95 //Loop over discusson threads array to create discussion thread HTML for the sidebar
96 var discussionHTML = dtps.classes[classNum].discussions.map(discussionThread => {
97 return /*html*/`
98 <div data-threadID="${discussionThread.id}" class="item">
99 <i class="fluid-icon">${discussionThread.locked ? "lock_outline" : "chat_bubble_outline"}</i>
j6ca9c7e2026-10-13 20:39:55 +0000100 <span class="label">${DOMPurify.sanitize(discussionThread.title)}</span>
j7940eec2020-12-28 14:00:41 -0600101 </div>
102 `;
103 }).join("");
104
105 //Render discussion threads in the sidebar
106 if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "discuss")) {
107 jQuery(".sidebar .items").html(/*html*/`
108 <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="item main back">
109 <i class="fluid-icon">keyboard_arrow_left</i> <span class="label">Classes</span>
110 </div>
111
112 ${
113 dtps.classes[classNum].newDiscussionThreadURL ? (/*html*/`
j6ca9c7e2026-10-13 20:39:55 +0000114 <div onclick="window.open(${dtps.escapeAttr(JSON.stringify(dtps.safeURL(dtps.classes[classNum].newDiscussionThreadURL)))})" class="item back">
j7940eec2020-12-28 14:00:41 -0600115 <i class="fluid-icon">add</i>
116 <span class="label">New discussion</span>
117 </div>
118 `) : ""
119 }
120
121 <div class="divider"></div>
122
123 ${discussionHTML}
124 `);
125
126 //Load default thread if provided
127 if (defaultThread) {
128 dtps.loadThreadPosts(classNum, defaultThread, fromModules, defaultPost);
129 }
130
131 //Add click event listeners for discussion threads
132 $(".sidebar .item:not(.back)").click(function (event) {
133 //Show the selected thread as active
134 $(this).siblings().removeClass("active");
135 $(this).addClass("active");
136
137 //Get thread ID from HTML attribute
138 var postID = $(this).attr("data-threadID");
139
140 //Load the thread
141 dtps.loadThreadPosts(classNum, postID);
142 });
143 }
144 }
145
146 }).catch(function (err) {
147 dtps.error("Couldn't fetch discussion threads", "Caught promise rejection @ dtps.loadThreadsList", err);
148 });
149}
150
151/**
152 * Fetches and displays posts in a discussion
153 *
154 * @param {number} classNum The class number to render
155 * @param {string} threadID The discussion thread to render
156 * @param {boolean} [fromModules] True if this page is being loaded from the moduleStream
157 * @param {string} [defaultPost] The post ID to jump to
158 */
159dtps.loadThreadPosts = function (classNum, threadID, fromModules, defaultPost) {
160 //Show loading indicator
161 if ((dtps.selectedClass == classNum) && ((dtps.selectedContent == "discuss") || fromModules)) {
162 jQuery(".classContent").html(/*html*/`
163 <div class="card" style="margin-top: 20px;margin-bottom: 75px;">
164 <h4><span class="shimmer">[SHIMMER] Thread Title</span></h4>
165
166 <div style="margin-bottom: 32px;" class="discussionHeader">
167 <h5 ><span class="shimmer">Discussion author name</span></h5>
168
169 <i class="fluid-icon shimmer">calendar_today</i>
170 <span class="shimmer">Discussion date</span>
171 </div>
172
173 <div class="shimmer" style="margin: 10px 0px; width: 100%; height: 400px; border: none; outline: none;"></div>
174
175 <div style="margin-top: 32px;" class="discussionFooter">
176 <button class="btn small shimmer"><i class="fluid-icon">post_add</i> Add Post</button>
177 </div>
178 </div>
179 `);
180 }
181
182 //Fetch discussion posts from the LMS
183 dtpsLMS.fetchDiscussionPosts(dtps.classes[classNum].lmsID, threadID).then(function (thread) {
184 //Post HTML array
185 var postHTML = [];
186
187 thread.posts.forEach((post, index) => {
188 //Get background and text color for iFrame content
189 var computedBackgroundColor = getComputedStyle($(".card.details")[0]).getPropertyValue("--cards");
190 var computedTextColor = getComputedStyle($(".card.details")[0]).getPropertyValue("--text");
191
192 //Create a new blob data URL with the post's content
193 var blob = new Blob([`
194 <base target="_blank" />
195 <link type="text/css" rel="stylesheet" href="https://cdn.jottocraft.com/CanvasCSS.css" media="screen,projection"/>
196 <style>body {background-color: ${computedBackgroundColor}; color: ${computedTextColor};</style>
j6ca9c7e2026-10-13 20:39:55 +0000197 ${dtps.sanitizeContent(post.body)}
j7940eec2020-12-28 14:00:41 -0600198 `], { type: 'text/html' });
199 var discussionPostContentURL = window.URL.createObjectURL(blob);
200
201 //Create HTML for replies
202 var replyHTML = [];
203 if (post.replies) {
204 //Add space above replies
205 replyHTML.push(`<br />`);
206
207 //Get HTML for each reply and add to array
208 post.replies.forEach(reply => {
209 replyHTML.push(/*html*/`
210 <div data-post-id="${reply.id}" style="margin-left: ${(reply.depth || 0) * 50}px;" class="discussionReply">
211 <div class="discussionHeader">
212 ${post.author ? /*html*/`
j6ca9c7e2026-10-13 20:39:55 +0000213 <img src="${dtps.escapeAttr(reply.author.photoURL)}" />
214 <h5>${DOMPurify.sanitize(reply.author.name)}</h5>
j7940eec2020-12-28 14:00:41 -0600215 ` : ``}
216
j6ca9c7e2026-10-13 20:39:55 +0000217 <span style="cursor: pointer;" onclick="window.open(${dtps.escapeAttr(JSON.stringify(dtps.safeURL(reply.replyURL)))});">
j7940eec2020-12-28 14:00:41 -0600218 <i class="fluid-icon">reply</i>
219 <span>Reply</span>
220 </span>
221 </div>
222
j6ca9c7e2026-10-13 20:39:55 +0000223 ${dtps.sanitizeContent(reply.body)}
j7940eec2020-12-28 14:00:41 -0600224 </div>
225 `)
226 });
227
228 //Add space below replies
229 replyHTML.push(`<br />`);
230 }
231
232 //Create HTML for this post
233 //Note that index == 0 is the initial post
234 postHTML.push(/*html*/`
j6ca9c7e2026-10-13 20:39:55 +0000235 <div class="card" data-post-id="${dtps.escapeAttr(post.id)}" style="margin-top: 20px;${index == 0 ? "margin-bottom: 75px;" : "padding: 20px 30px;"}">
j7940eec2020-12-28 14:00:41 -0600236 <!-- Thread title (Initial post) -->
237 ${index == 0 ? /*html*/`
j6ca9c7e2026-10-13 20:39:55 +0000238 <h4 style="font-weight: bold">${DOMPurify.sanitize(thread.title)}</h4>
j7940eec2020-12-28 14:00:41 -0600239 ` : ''}
240
241 <!-- Author header -->
242 <div ${index == 0 ? `style="margin-bottom: 32px;"` : ""} class="discussionHeader">
243 ${post.author ? /*html*/`
j6ca9c7e2026-10-13 20:39:55 +0000244 <img src="${dtps.escapeAttr(post.author.photoURL)}" />
245 <h5>${DOMPurify.sanitize(post.author.name)}</h5>
j7940eec2020-12-28 14:00:41 -0600246 ` : ``}
247
248 <i class="fluid-icon">calendar_today</i>
249 <span>${dtps.formatDate(post.postedAt)}</span>
250
251 <!-- Thread info (initial post) -->
252 ${index == 0 ? /*html*/`
253 ${thread.locked ? `<i class="fluid-icon">lock</i>` : ""}
254 ${thread.requireInitialPost ? /*html*/`
255 <i class="fluid-icon">visibility</i>
256 <span>You must post before you can see other replies</span>
257 ` : ""}
258 ` : ''}
259 </div>
260
261 ${index == 0 ? /*html*/`
j6ca9c7e2026-10-13 20:39:55 +0000262 <iframe id="classThreadIframe" onload="dtps.iframeLoad('classThreadIframe')" style="margin: 10px 0px; width: 100%; border: none; outline: none;" src="${discussionPostContentURL}"></iframe>
263 ` : dtps.sanitizeContent(post.body)}
j7940eec2020-12-28 14:00:41 -0600264
265 ${replyHTML.join("")}
266
267 <!-- Reply / Add post footer -->
268 ${post.replyURL ? /*html*/`
269 <div ${index == 0 ? `style="margin-top: 32px;"` : ""} class="discussionFooter">
270 ${index == 0 ? /*html*/`
j6ca9c7e2026-10-13 20:39:55 +0000271 <button onclick="window.open(${dtps.escapeAttr(JSON.stringify(dtps.safeURL(post.replyURL)))});" class="btn small"><i class="fluid-icon">post_add</i> Add Post</button>
j7940eec2020-12-28 14:00:41 -0600272 ` : /*html*/`
j6ca9c7e2026-10-13 20:39:55 +0000273 <button onclick="window.open(${dtps.escapeAttr(JSON.stringify(dtps.safeURL(post.replyURL)))});" class="btn small"><i class="fluid-icon">reply</i> Reply</button>
j7940eec2020-12-28 14:00:41 -0600274 `}
275 </div>
276 ` : ""}
277 </div>
278 `);
279 });
280
281 //Render HTML
282 if ((dtps.selectedClass == classNum) && ((dtps.selectedContent == "discuss") || fromModules)) {
283 jQuery(".classContent").html((fromModules ? /*html*/`
284 <button style="margin: 10px 0px 0px 20px;" class="btn" onclick="fluid.screen('moduleStream', '${dtps.classes[classNum].id}')">
285 <i class="fluid-icon">keyboard_arrow_left</i> Back
286 </button>
287 ` : "") + postHTML.join(""));
288
289 //Jump to post if specified
290 if (defaultPost) {
291 $("[data-post-id=" + defaultPost + "]").get(0).scrollIntoView();
292 }
293 }
294 }).catch(function (err) {
295 dtps.error("Could not fetch discussion posts", "Caught promise rejection @ dtps.loadThreadPosts", err);
296 });
297}
298
299/**
300 * Renders the pages list for a class
301 *
302 * @param {string} courseID The course ID to render pages for
303 * @param {string} [defaultPage] If provided, load the pageID by default
304 * @param {boolean} fromModules True if this page is being loaded from the moduleStream
305 */
306dtps.loadPagesList = function (courseID, defaultPage, fromModules) {
307 //Get class index and set as selected class
308 var classNum = dtps.classes.map(course => course.id).indexOf(courseID);
309 dtps.selectedClass = classNum;
310
311 //Set pages as the selected content
312 if (!fromModules) {
313 dtps.selectedContent = "pages";
314 $("#dtpsTabBar .btn").removeClass("active");
315 $("#dtpsTabBar .btn.pages").addClass("active");
316 jQuery("body").removeClass("collapsedSidebar");
317 }
318
319 if (classNum == -1) {
320 //Class does not exist
321 dtps.error("The selected class doesn't exist", "classNum check failed @ dtps.loadPagesList");
322 }
323
324 //Load class color and things
325 dtps.presentClass(classNum);
326
327 //Load module page
328 if (fromModules) {
329 dtps.loadPage(classNum, defaultPage, fromModules);
330 return;
331 }
332
333 if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "pages")) {
334 //Render sidebar
335 jQuery(".sidebar").html(/*html*/`
336 <div class="title">
337 <i style="font-size: 28px; margin-right: 7px; vertical-align: middle;" class="fluid-icon">insert_drive_file</i>
338 <h4>Pages</h4>
339 </div>
340
341 <div class="items">
342 <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="item main back">
343 <i class="fluid-icon">keyboard_arrow_left</i> <span class="label">Classes</span>
344 </div>
345
346 <div class="divider"></div>
347
348 <div class="item shimmerParent">
349 <i class="fluid-icon">star</i>
350 <span class="label">Class page title</span>
351 </div>
352 <div class="item shimmerParent">
353 <i class="fluid-icon">star</i>
354 <span class="label">Class page title</span>
355 </div>
356 <div class="item shimmerParent">
357 <i class="fluid-icon">star</i>
358 <span class="label">Class page title</span>
359 </div>
360 </div>
361 `);
362
363 //Delete existing class content HTML
364 jQuery(".classContent").html("");
365 }
366
367 dtpsLMS.fetchPages(dtps.classes[classNum].lmsID).then(function (pagesData) {
368 //Store fetched pages data to the class
369 dtps.classes[classNum].pages = pagesData;
370
371 if (pagesData.length == 0) {
372 //No pages in this class
373 jQuery(".sidebar .items").html(/*html*/`
374 <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="item main back">
375 <i class="fluid-icon">keyboard_arrow_left</i>
376 <span class="label">Classes</span>
377 </div>
378
379 <p style="text-align: center; font-weight: bold; margin-top: 60px; margin-bottom: 10px;">No pages found</p>
380 <p style="text-align: center; font-size: 14px; margin: 0px;">This class doesn't have any pages</p>
381 `);
382 } else {
383 //Loop over discusson threads array to create discussion thread HTML for the sidebar
384 var pageHTML = dtps.classes[classNum].pages.map(page => {
385 return /*html*/`
j6ca9c7e2026-10-13 20:39:55 +0000386 <div data-pageID="${dtps.escapeAttr(page.id)}" class="item ${(defaultPage && (page.id == defaultPage)) ? "active" : ""}">
j7940eec2020-12-28 14:00:41 -0600387 <i class="fluid-icon">insert_drive_file</i>
j6ca9c7e2026-10-13 20:39:55 +0000388 <span class="label">${DOMPurify.sanitize(page.title)}</span>
j7940eec2020-12-28 14:00:41 -0600389 </div>
390 `;
391 }).join("");
392
393 //Render discussion threads in the sidebar
394 if ((dtps.selectedClass == classNum) && (dtps.selectedContent == "pages")) {
395 jQuery(".sidebar .items").html(/*html*/`
396 <div onclick="fluid.screen('stream', '${dtps.classes[classNum].id}');" class="item main back">
397 <i class="fluid-icon">keyboard_arrow_left</i>
398 <span class="label">Classes</span>
399 </div>
400
401 <div class="divider"></div>
402
403 ${pageHTML}
404 `);
405 }
406
407 //Load default page if provided
408 if (defaultPage) {
409 dtps.loadPage(classNum, defaultPage);
410 }
411
412 //Add click event listeners for pages
413 $(".sidebar .item:not(.back)").click(function (event) {
414 //Show the selected thread as active
415 $(this).siblings().removeClass("active");
416 $(this).addClass("active");
417
418 //Get page ID from HTML attribute
419 var pageID = $(this).attr("data-pageID");
420
421 //Load the page content
422 dtps.loadPage(classNum, pageID);
423 });
424 }
425 }).catch((err) => {
426 dtps.error("Couldn't fetch pages", "Caught promise rejection @ dtps.loadPagesList", err);
427 });
428}
429
430/**
431 * Fetches and renders a page and its contents
432 *
433 * @param {string} classNum The class number of the page to render
434 * @param {string} pageID The page ID to render
435 * @param {boolean} fromModules True if this page is being loaded from the moduleStream
436 */
437dtps.loadPage = function (classNum, pageID, fromModules) {
438 //Show loading indicator
439 if ((dtps.selectedClass == classNum) && ((dtps.selectedContent == "pages") || fromModules)) {
440 jQuery(".classContent").html(/*html*/`
441 <div style="margin: 20px; padding: 20px;">
442 <h4><span class="shimmer">[SHIMMER] Class page title</span></h4>
443
444 <div style="margin-bottom: 32px;" class="discussionHeader">
445 <h5 class="shimmer">Page author name</h5>
446
447 <i class="fluid-icon shimmer">calendar_today</i>
448 <span class="shimmer">[SHIMMER] Last updated at</span>
449 </div>
450
451 <!-- Page content -->
452 <br />
453 <div class="shimmer" style="margin: 10px 0px; width: 100%; height: 600px; border: none; outline: none;"></div>
454 </div>
455 `);
456 }
457
458 //Fetch page content
459 dtpsLMS.fetchPageContent(dtps.classes[classNum].lmsID, pageID).then(function (page) {
460 if ((dtps.selectedClass == classNum) && ((dtps.selectedContent == "pages") || fromModules)) {
461 //Get computed background and text color to style the iFrame with
462 var computedBackgroundColor = getComputedStyle($(".classContent")[0]).getPropertyValue("--background");
463 var computedTextColor = getComputedStyle($(".card.details")[0]).getPropertyValue("--text");
464
465 //Generate a blob with the page content and get its data URL
466 var blob = new Blob([`
467 <base target="_blank" />
468 <link type="text/css" rel="stylesheet" href="https://cdn.jottocraft.com/CanvasCSS.css" media="screen,projection"/>
469 <style>body {background-color: ${computedBackgroundColor}; color: ${computedTextColor};</style>
j6ca9c7e2026-10-13 20:39:55 +0000470 ${dtps.sanitizeContent(page.content)}
j7940eec2020-12-28 14:00:41 -0600471 `], { type: 'text/html' });
472
473 //Get URL from blob
474 var pageContentURL = window.URL.createObjectURL(blob);
475
476 //Render page card in the class content
477 jQuery(".classContent").html(/*html*/`
478 ${fromModules ? /*html*/`
479 <button style="margin: 10px 0px 0px 20px;" class="btn" onclick="fluid.screen('moduleStream', '${dtps.classes[classNum].id}')">
480 <i class="fluid-icon">keyboard_arrow_left</i> Back
481 </button>
482 ` : ""}
483 <div style="margin: 20px; padding: 20px;">
484 <!-- Page title -->
j6ca9c7e2026-10-13 20:39:55 +0000485 <h4 style="font-weight: bold;">${DOMPurify.sanitize(page.title)}</h4>
j7940eec2020-12-28 14:00:41 -0600486
487 <!-- Page header -->
488 <div style="margin-bottom: 32px;" class="discussionHeader">
489 ${page.author ? /*html*/`
j6ca9c7e2026-10-13 20:39:55 +0000490 <img src="${dtps.escapeAttr(page.author.photoURL)}" />
491 <h5>${DOMPurify.sanitize(page.author.name)}</h5>
j7940eec2020-12-28 14:00:41 -0600492 ` : ``}
493
494 <i class="fluid-icon">calendar_today</i>
495 <span>${"Last Updated " + dtps.formatDate(page.updatedAt)}</span>
496 </div>
497
498 <!-- Page content -->
499 <br />
j6ca9c7e2026-10-13 20:39:55 +0000500 <iframe id="classPageIframe" onload="dtps.iframeLoad('classPageIframe')" style="margin: 10px 0px; width: 100%; border: none; outline: none;" src="${pageContentURL}"></iframe>
j7940eec2020-12-28 14:00:41 -0600501 </div>
502 `);
503 }
504 }).catch((err) => {
505 dtps.error("Couldn't load page", "Caught promise rejection @ dtps.loadPage", err);
506 });
507}
508
509//Fluid UI screen definitions
510fluid.externalScreens.discussions = (param) => {
511 //Split parameter string into variables
512 var courseID = param.split("|")[0];
513 var threadID = param.split("|")[1];
514 var fromModules = param.split("|")[2] == "true";
515 var postID = param.split("|")[3];
516
517 dtps.loadThreadsList(courseID, threadID, fromModules, postID);
518}
519
520fluid.externalScreens.pages = (param) => {
521 //Split parameter string into variables
522 var courseID = param.split("|")[0];
523 var pageID = param.split("|")[1];
524 var fromModules = param.split("|")[2] == "true";
525
526 dtps.loadPagesList(courseID, pageID, fromModules);
527}
528
529//Type definitions
530
531/**
532* @typedef {Object} PartialDiscussionThread
533* @description Defines partial discussion thread objects in DTPS (for threads list)
534* @property {string} title Title of the discussion thread
535* @property {string} id Discussion thread ID
536* @property {boolean} [locked] True if posting to the discussion thread is locked
537*/
538
539/**
540* @typedef {Object} DiscussionThread
541* @description Defines discussion thread objects in DTPS
542* @property {string} title Title of the discussion thread
543* @property {string} id Discussion thread ID
544* @property {DiscussionPost[]} posts Posts in this thread, with the initial one first.
545* @property {boolean} [locked] True if posting to the discussion thread is locked
546* @property {boolean} [requireInitialPost] True if the user must post before viewing others' posts
547*/
548
549/**
550* @typedef {Object} DiscussionPost
551* @description Defines discussion post objects in DTPS
552* @property {string} id Discussion post ID
553* @property {string} body Discussion post body HTML
554* @property {Date} postedAt Date for when the post was posted
555* @property {number} [depth] The depth level this post is
556* @property {User} [author] Discussion post author
557* @property {DiscussionPost[]} [replies] Replies to this post. Nested replies (replies to replies) should be after this post in the array with a depth of 1, not in the replies key.
558* @property {string} [replyURL] A URL that the user can visit to reply to this post
559*/
560
561/**
562* @typedef {Object} PartialPage
563* @description Defines a partial page object in DTPS (for pages list)
564* @property {string} title Page title
565* @property {string} id Page ID
566*/
567
568/**
569* @typedef {Object} Page
570* @description Defines Page objects in DTPS
571* @property {string} title Page title
572* @property {string} id Page ID
573* @property {string} content Page content HTML
574* @property {Date} [updatedAt] When the page was last updated
575* @property {User} [author] Page author
j1c53f822020-06-07 15:32:06 -0700576*/