@blogmcp/sdk 0.10.1 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/community/channels.d.ts +3 -2
- package/dist/community/client.d.ts +130 -3
- package/dist/community/client.js +232 -161
- package/dist/community/forum.d.ts +82 -0
- package/dist/community/forum.js +96 -0
- package/dist/community/index.d.ts +14 -7
- package/dist/community/index.js +185 -121
- package/dist/community/links.d.ts +38 -0
- package/dist/community/links.js +98 -71
- package/dist/community/messages.cs.d.ts +164 -3
- package/dist/community/messages.cs.js +184 -3
- package/dist/community/messages.d.ts +19 -1
- package/dist/community/messages.en.d.ts +154 -3
- package/dist/community/messages.en.js +167 -3
- package/dist/community/messages.js +37 -28
- package/dist/community/outcome.d.ts +8 -3
- package/dist/community/outcome.js +61 -20
- package/dist/community/poll.d.ts +28 -4
- package/dist/community/poll.js +70 -47
- package/dist/community/realtime/index.d.ts +19 -3
- package/dist/community/realtime/index.js +175 -145
- package/dist/community/routes.d.ts +36 -1
- package/dist/community/routes.js +51 -21
- package/dist/community/server/bff.d.ts +25 -2
- package/dist/community/server/bff.js +135 -118
- package/dist/community/server/host-routes.d.ts +3 -0
- package/dist/community/server/host-routes.js +17 -0
- package/dist/community/server/index.d.ts +5 -1
- package/dist/community/shapes.d.ts +649 -7
- package/dist/community/shapes.js +92 -61
- package/dist/community/store.d.ts +27 -0
- package/dist/community/store.js +84 -80
- package/dist/community/topic.d.ts +173 -0
- package/dist/community/topic.js +225 -0
- package/dist/nuxt/composables/useAsyncKb.d.ts +10 -4
- package/dist/packages/mdx-render-vue/dist/render/gallery/GalleryLightbox.vue.js +2 -2
- package/dist/packages/mdx-render-vue/dist/render/tripmap/TripMapDefault.vue.js +36 -36
- package/package.json +3 -3
- package/src/community/channels.ts +3 -2
- package/src/community/client.ts +212 -7
- package/src/community/forum.ts +209 -0
- package/src/community/index.ts +146 -2
- package/src/community/links.ts +64 -4
- package/src/community/messages.cs.ts +185 -3
- package/src/community/messages.en.ts +168 -3
- package/src/community/messages.ts +25 -2
- package/src/community/outcome.ts +47 -1
- package/src/community/poll.ts +79 -17
- package/src/community/realtime/index.ts +124 -48
- package/src/community/routes.ts +42 -1
- package/src/community/server/bff.ts +89 -30
- package/src/community/server/host-routes.ts +20 -0
- package/src/community/server/index.ts +5 -1
- package/src/community/shapes.ts +677 -6
- package/src/community/store.ts +25 -7
- package/src/community/topic.ts +521 -0
- package/src/core/markdown.ts +1 -1
- package/src/nuxt/composables/useAsyncKb.ts +11 -4
- package/src/nuxt/nuxt-imports.d.ts +2 -2
|
@@ -27,9 +27,14 @@ const e = {
|
|
|
27
27
|
"error.mentionLimit": "This post mentions more people than you can mention yet. Remove some of the mentions and send it again.",
|
|
28
28
|
"error.pushRefused": "Notifications cannot be switched on in this browser. Try another browser, or keep an eye on the notifications page.",
|
|
29
29
|
"error.realtimeOff": "New posts do not show up instantly here right now. The discussion refreshes itself every so often.",
|
|
30
|
+
"error.membersOnly": "The forum is open to community members. Sign in and join the community to see it.",
|
|
31
|
+
"error.topicLocked": "This topic is closed, so you can't post in it any more. You can still read it.",
|
|
32
|
+
"error.topicCreationClosed": "You can't start a new topic in this category. Please try another one.",
|
|
33
|
+
"error.followLimit": "You're already following a lot. Please unfollow something and try again.",
|
|
30
34
|
"error.submit": "That didn't work. Please reload the page and try again.",
|
|
31
35
|
"need.sign_in": "Sign in to write in the discussion.",
|
|
32
|
-
|
|
36
|
+
// O-16 / F-51: the first join confirms the rules and the terms in one go (the terms once, never again).
|
|
37
|
+
"need.onboarding": "Before your first comment, choose a name and confirm the discussion rules and terms.",
|
|
33
38
|
"need.reconsent_rules": "The discussion rules have changed. Please confirm the new version.",
|
|
34
39
|
"need.art9_consent": "To write in the discussion, we need your consent to the processing.",
|
|
35
40
|
"state.visible": "Published",
|
|
@@ -146,6 +151,9 @@ const e = {
|
|
|
146
151
|
"onboarding.rulesLede": "Please read how the discussion works.",
|
|
147
152
|
"onboarding.rulesLink": "The full rules",
|
|
148
153
|
"onboarding.rulesAccept": "I agree to the discussion rules.",
|
|
154
|
+
// O-16 / F-51: the one consent of a first join where the tenant has terms (the rules and the terms, each linked).
|
|
155
|
+
"onboarding.rulesTermsAccept": "I agree to the discussion rules and the terms.",
|
|
156
|
+
"onboarding.termsLink": "The discussion terms",
|
|
149
157
|
"onboarding.rulesChanged": "The discussion rules have changed since your last visit. Please read the new version and confirm it.",
|
|
150
158
|
"onboarding.art9Title": "Consent to processing",
|
|
151
159
|
"onboarding.art9Lede": "To write in the discussion, we need your consent as described below.",
|
|
@@ -201,7 +209,7 @@ const e = {
|
|
|
201
209
|
"panel.art9Refused": "You declined the consent to the processing.",
|
|
202
210
|
"panel.art9Withdraw": "Withdraw consent",
|
|
203
211
|
"panel.art9WithdrawTitle": "Withdraw your consent to the processing?",
|
|
204
|
-
"panel.art9WithdrawExplain": "You can keep reading the discussion.
|
|
212
|
+
"panel.art9WithdrawExplain": "You can keep reading the discussion. The forum posts you wrote under the consent are erased after 7 days — give the consent again before then and they stay. Whether you can write without the consent depends on the website's settings; it tells you before your next comment.",
|
|
205
213
|
"panel.art9WithdrawConfirm": "Yes, withdraw consent",
|
|
206
214
|
"panel.art9WithdrawCancel": "Keep the consent",
|
|
207
215
|
"panel.art9Withdrawn": "You've withdrawn your consent.",
|
|
@@ -269,6 +277,10 @@ const e = {
|
|
|
269
277
|
"appealStatus.upheld": "The decision stands",
|
|
270
278
|
"appealStatus.reversed": "The decision was reversed",
|
|
271
279
|
"appealStatus.withdrawn": "Withdrawn",
|
|
280
|
+
// M3 F6/F9 (m3-contracts.md §3.5, §4.7): what the team recorded on an adverse-event case (adverseOutcomeMessageKey).
|
|
281
|
+
"adverseOutcome.recorded": "Assessed as a possible adverse reaction and recorded in the register.",
|
|
282
|
+
"adverseOutcome.reported_to_authority": "Assessed as a possible adverse reaction and reported to the competent authority.",
|
|
283
|
+
"adverseOutcome.not_adverse": "Assessed: it is not an adverse reaction.",
|
|
272
284
|
"notification.decision": "There is a new decision about your content.",
|
|
273
285
|
"notification.appeal_resolved": "Your appeal has been resolved.",
|
|
274
286
|
"notification.erasure_scheduled": "The deletion of your discussion profile is scheduled.",
|
|
@@ -279,6 +291,9 @@ const e = {
|
|
|
279
291
|
"notification.mention": "Someone mentioned you in a discussion.",
|
|
280
292
|
"notification.module_push_reset": "Browser notifications need to be switched on again in your community settings.",
|
|
281
293
|
"notification.age_limit_changed": "The community is now for adults only, so your profile is read-only. The details are on the My community page.",
|
|
294
|
+
"notification.topic_update": "A discussion you follow has a new post.",
|
|
295
|
+
"notification.category_topic": "A category you follow has a new topic.",
|
|
296
|
+
"notification.category_topic.article": "A category you follow has a new discussion under an article.",
|
|
282
297
|
"centre.title": "Notifications",
|
|
283
298
|
"centre.empty": "New notifications will show here.",
|
|
284
299
|
"centre.markAllRead": "Mark all as read",
|
|
@@ -320,7 +335,8 @@ const e = {
|
|
|
320
335
|
"trust.0": "New member",
|
|
321
336
|
"trust.1": "Member",
|
|
322
337
|
"trust.2": "Regular",
|
|
323
|
-
"trust.3": "
|
|
338
|
+
"trust.3": "Trusted member",
|
|
339
|
+
"role.moderator": "Moderator",
|
|
324
340
|
"welcome.title": "Welcome to the community",
|
|
325
341
|
"welcome.lede": "Here are a few things that help at the start.",
|
|
326
342
|
"welcome.rules": "How the discussion works",
|
|
@@ -330,6 +346,151 @@ const e = {
|
|
|
330
346
|
"realtime.off": "Live updates are off right now. The discussion refreshes itself every so often.",
|
|
331
347
|
"state.readOnly": "The community's extra features are switched off for now. The discussion under the article goes on.",
|
|
332
348
|
"state.braked": "Writing is paused for a while. You can keep reading.",
|
|
349
|
+
"state.away": "The team is away for now; new topics will wait for review.",
|
|
350
|
+
"topic.deleted": "Deleted topic",
|
|
351
|
+
// M3 (§3.1, B06): a title §3.1's placeholder rule keeps from the viewer (held, removed or held back) — never a deletion,
|
|
352
|
+
// wherever a title reads: a topic, a category's row, a search hit, a moderator's package (M3 FX2, S12: a deleted
|
|
353
|
+
// opening post reads `topic.deleted` in each — topicTitleOf over `openingState`).
|
|
354
|
+
"topic.withheld": "Topic title unavailable",
|
|
355
|
+
// M3 F9 (§3.3, B16): the follow button — following needs a target the member may read now; unfollowing never fails.
|
|
356
|
+
"follow.follow": "Follow",
|
|
357
|
+
"follow.following": "Following",
|
|
358
|
+
"follow.followed": "You're following. You'll see what's new in your notifications.",
|
|
359
|
+
"follow.unfollowed": "You've stopped following.",
|
|
360
|
+
"follow.unavailable": "You can't follow this right now.",
|
|
361
|
+
// ── M3 F9: the forum's elements (forum.*, forumCategory.*, topic.*, search.*, moderation.*; m3-contracts.md §5.3) ──
|
|
362
|
+
"forum.title": "Forum",
|
|
363
|
+
"forum.loading": "Loading the forum…",
|
|
364
|
+
"forum.empty": "The forum has no categories yet.",
|
|
365
|
+
"forum.topicCount_one": "{count} topic",
|
|
366
|
+
"forum.topicCount_other": "{count} topics",
|
|
367
|
+
"forum.discussionCount_one": "{count} discussion",
|
|
368
|
+
"forum.discussionCount_other": "{count} discussions",
|
|
369
|
+
"forum.lastActivity": "Last activity {date}",
|
|
370
|
+
"forum.latest": "Latest topics",
|
|
371
|
+
"forum.allTopics": "All topics",
|
|
372
|
+
"forum.allCategories": "All categories",
|
|
373
|
+
"forum.search": "Search the forum",
|
|
374
|
+
"forum.searchSubmit": "Search",
|
|
375
|
+
"forum.modePre": "New posts here wait for review before they appear.",
|
|
376
|
+
"forum.teamTopics": "The team starts the topics here.",
|
|
377
|
+
"forum.join": "Join the community",
|
|
378
|
+
"forum.back": "Back to the forum",
|
|
379
|
+
// The forum's own brake (§4.9): its writes pause, the article discussions go on.
|
|
380
|
+
"state.forumBraked": "Posting in the forum is paused for a while. You can keep reading.",
|
|
381
|
+
"forumCategory.notFound": "We couldn't find this category.",
|
|
382
|
+
"forumCategory.empty": "There are no topics in this category yet.",
|
|
383
|
+
"forumCategory.articlesEmpty": "There are no article discussions here yet.",
|
|
384
|
+
"forumCategory.sort": "Sort",
|
|
385
|
+
"forumCategory.sortActivity": "By activity",
|
|
386
|
+
"forumCategory.sortNew": "Newest",
|
|
387
|
+
"forumCategory.newTopic": "New topic",
|
|
388
|
+
"topic.loading": "Loading the topic…",
|
|
389
|
+
"topic.notFound": "We couldn't find this topic. It may no longer be available.",
|
|
390
|
+
"topic.count_one": "{count} post",
|
|
391
|
+
"topic.count_other": "{count} posts",
|
|
392
|
+
"topic.locked": "Closed",
|
|
393
|
+
"topic.archived": "Archived",
|
|
394
|
+
"topic.pinned": "Pinned",
|
|
395
|
+
"topic.titleLabel": "Topic title",
|
|
396
|
+
"topic.titleMissing": "Please give the topic a title.",
|
|
397
|
+
"topic.titleTooLong": "The title is too long. Please shorten it to {max} characters at most.",
|
|
398
|
+
"topic.bodyLabel": "Opening post",
|
|
399
|
+
"topic.create": "Start the topic",
|
|
400
|
+
"topic.created": "The topic is up.",
|
|
401
|
+
"topic.createdHeld": "We've got the topic; it's awaiting review now.",
|
|
402
|
+
"topic.open": "Open the topic",
|
|
403
|
+
// A topic's thread reads the discussion's texts with these words of the forum's (the topic element maps the keys).
|
|
404
|
+
"forumText.composer.label": "Your post",
|
|
405
|
+
"forumText.composer.editLabel": "Editing the post",
|
|
406
|
+
"forumText.composer.placeholder": "Write a post…",
|
|
407
|
+
"forumText.composer.tooLong": "The post is too long. Please shorten it to {max} characters at most.",
|
|
408
|
+
"forumText.composer.linksNote_one": "A post can hold up to {count} link.",
|
|
409
|
+
"forumText.composer.linksNote_other": "A post can hold up to {count} links.",
|
|
410
|
+
"forumText.composer.posted": "The post is published.",
|
|
411
|
+
"forumText.composer.held": "We've got the post; it's awaiting review now.",
|
|
412
|
+
"forumText.composer.cooldown_one": "You can post again in {count} second.",
|
|
413
|
+
"forumText.composer.cooldown_other": "You can post again in {count} seconds.",
|
|
414
|
+
"forumText.discussion.empty": "There aren't any replies yet. Be the first to reply.",
|
|
415
|
+
"forumText.discussion.deleteTitle": "Delete the post?",
|
|
416
|
+
"forumText.discussion.deleteExplain": "The post disappears. If someone has replied to it, an empty placeholder stays in its place.",
|
|
417
|
+
"forumText.discussion.collapsed": "A post by an author you've blocked.",
|
|
418
|
+
"forumText.discussion.heldNote": "The post is awaiting review and only you can see it for now. After the review it shows to others, or you'll find out why not in My community.",
|
|
419
|
+
"forumText.discussion.hiddenUntilConsentNote": "Only you can see this post for now. Others will see it once you give your consent to the processing.",
|
|
420
|
+
"forumText.discussion.removedNote": "We removed this post; others can't see it.",
|
|
421
|
+
"forumText.discussion.placeholderHeld": "This post is awaiting review.",
|
|
422
|
+
"forumText.discussion.placeholderRemoved": "This post was removed.",
|
|
423
|
+
"forumText.discussion.placeholderDeleted": "This post was deleted.",
|
|
424
|
+
"forumText.report.title": "Report the post",
|
|
425
|
+
"forumText.report.category": "What's wrong with the post?",
|
|
426
|
+
"forumText.error.links": "This post has more links than fit. Please remove some of them.",
|
|
427
|
+
"forumText.error.blocked": "This post can't be published as it is. Please try editing it.",
|
|
428
|
+
"forumText.error.confirm": "Before you send the post, please confirm one thing.",
|
|
429
|
+
"forumText.confirm.other": "I understand the notice and want to send the post.",
|
|
430
|
+
"forumText.warning.identifier": "The post seems to contain an e-mail address, a phone number or an account number. If it shouldn't be there, edit the post.",
|
|
431
|
+
"forumText.warning.other": "The post is published, but the discussion rules flag something in it. Please look it over.",
|
|
432
|
+
"forumText.need.onboarding": "Before your first post, choose a name and confirm the discussion rules and terms.",
|
|
433
|
+
"forumText.need.art9_consent": "To write in the forum, we need your consent to the processing.",
|
|
434
|
+
"search.title": "Search the forum",
|
|
435
|
+
"search.label": "What are you looking for?",
|
|
436
|
+
"search.submit": "Search",
|
|
437
|
+
"search.searching": "Searching…",
|
|
438
|
+
"search.tooShort": "Please type at least {min} characters.",
|
|
439
|
+
"search.tooLong": "The search text is too long. Please shorten it to {max} characters at most.",
|
|
440
|
+
"search.empty": "We found no results for that. Try other words.",
|
|
441
|
+
"search.more": "More results",
|
|
442
|
+
"search.lastPage": "We don't show more results. Try narrowing the search.",
|
|
443
|
+
"search.space": "Where to search",
|
|
444
|
+
"search.spaceAll": "Everywhere",
|
|
445
|
+
"search.spaceForum": "In the forum",
|
|
446
|
+
"search.spaceArticle": "In article discussions",
|
|
447
|
+
"search.category": "Category",
|
|
448
|
+
"search.topic": "Topic",
|
|
449
|
+
"search.message": "Post",
|
|
450
|
+
"search.inArticle": "An article discussion",
|
|
451
|
+
"moderation.title": "Moderation",
|
|
452
|
+
"moderation.loading": "Loading the queue…",
|
|
453
|
+
"moderation.empty": "The queue is empty right now.",
|
|
454
|
+
"moderation.source.member_report": "Reported by a member",
|
|
455
|
+
"moderation.source.filter": "Caught by the filters",
|
|
456
|
+
"moderation.source.staff": "From the team",
|
|
457
|
+
"moderation.premod": "Awaiting approval",
|
|
458
|
+
"moderation.heldBySystem": "Hidden automatically for now",
|
|
459
|
+
"moderation.deadline": "Due by {date}",
|
|
460
|
+
"moderation.open": "Review",
|
|
461
|
+
"moderation.package": "Content to review",
|
|
462
|
+
"moderation.itemWithheld": "Others can't see this post now, so it isn't shown here.",
|
|
463
|
+
"moderation.restriction": "Decision",
|
|
464
|
+
"moderation.factsHint": "Describe what you found. The text becomes part of the statement of reasons for the author.",
|
|
465
|
+
"moderation.ruleRequired": "Please choose the rule the decision rests on.",
|
|
466
|
+
"moderation.preview": "Preview the statement",
|
|
467
|
+
"moderation.previewTitle": "This is the statement the author will see",
|
|
468
|
+
"moderation.decide": "Decide",
|
|
469
|
+
"moderation.decided": "Decided.",
|
|
470
|
+
"moderation.escalate": "Pass to the team",
|
|
471
|
+
"moderation.escalateLede": "Do you think it's illegal? Pass it to the site's team to assess.",
|
|
472
|
+
"moderation.escalateCategory": "What is it?",
|
|
473
|
+
"moderation.escalated": "Passed to the team.",
|
|
474
|
+
"moderation.remove": "Remove as a moderator",
|
|
475
|
+
"moderation.removeLede": "The post disappears and its author gets a statement of reasons they can appeal.",
|
|
476
|
+
"moderation.removed": "Removed. The author got a statement of reasons.",
|
|
477
|
+
"moderation.approve": "Publish",
|
|
478
|
+
"moderation.approved": "Published.",
|
|
479
|
+
"moderation.reject": "Reject",
|
|
480
|
+
"moderation.rejected": "Rejected. The author got a statement of reasons.",
|
|
481
|
+
"moderation.gone": "This item is no longer in the queue.",
|
|
482
|
+
// M3 FX (R3): a pre-moderated text the author edited while it was being reviewed.
|
|
483
|
+
"moderation.textChanged": "The author has edited the text since. Read the new version and decide again.",
|
|
484
|
+
"moderation.lock": "Close the topic",
|
|
485
|
+
"moderation.unlock": "Reopen the topic",
|
|
486
|
+
"moderation.pin": "Pin the topic",
|
|
487
|
+
"moderation.unpin": "Unpin the topic",
|
|
488
|
+
"moderation.move": "Move the topic",
|
|
489
|
+
"moderation.moveTo": "Where to move the topic?",
|
|
490
|
+
"moderation.done": "Done.",
|
|
491
|
+
"moderation.openTopic": "View in the topic",
|
|
492
|
+
// A member's profile: the categories they moderate now (PublicProfile.moderates; „Moderátor" is role.moderator).
|
|
493
|
+
"profile.moderates": "In the categories",
|
|
333
494
|
"mention.limit": "This post mentions more people than you can mention yet.",
|
|
334
495
|
"notice.title": "Report content",
|
|
335
496
|
"notice.lede": "You can report a comment, a profile or an article, even without signing in.",
|
|
@@ -359,6 +520,9 @@ const e = {
|
|
|
359
520
|
"notice.submittedAt": "Sent on {date}",
|
|
360
521
|
"notice.decidedAt": "Decided on {date}",
|
|
361
522
|
"notice.statement": "Statement of reasons",
|
|
523
|
+
// M3 F6/F9: a notice closed by an adverse-event outcome alone — the outcome in plain words and the redress line.
|
|
524
|
+
"notice.outcome": "Outcome",
|
|
525
|
+
"notice.redress": "If you disagree with how it was dealt with, you can turn to a court or use an out-of-court dispute settlement.",
|
|
362
526
|
"notice.appealTitle": "Appeal",
|
|
363
527
|
"notice.appealLede": "Don't agree with how we handled the report? Tell us why.",
|
|
364
528
|
"notice.appealBody": "Why don't you agree with the decision?",
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { COMMUNITY_MESSAGES_CS as
|
|
2
|
-
import { COMMUNITY_MESSAGES_EN as
|
|
3
|
-
import { NOTIFICATION_CODES as
|
|
1
|
+
import { COMMUNITY_MESSAGES_CS as g } from "./messages.cs.js";
|
|
2
|
+
import { COMMUNITY_MESSAGES_EN as y } from "./messages.en.js";
|
|
3
|
+
import { NOTIFICATION_CODES as p, TRUST_LABELS as M, ADVERSE_EVENT_OUTCOMES as O } from "./shapes.js";
|
|
4
4
|
const c = Object.freeze({
|
|
5
|
-
cs: Object.freeze(
|
|
6
|
-
en: Object.freeze(
|
|
5
|
+
cs: Object.freeze(g),
|
|
6
|
+
en: Object.freeze(y)
|
|
7
7
|
});
|
|
8
|
-
function
|
|
8
|
+
function S(t) {
|
|
9
9
|
return (typeof t == "string" ? t.toLowerCase().split("-")[0] : "") === "cs" ? "cs" : "en";
|
|
10
10
|
}
|
|
11
11
|
const u = /* @__PURE__ */ new Map();
|
|
12
|
-
function
|
|
12
|
+
function _(t, n) {
|
|
13
13
|
if (!u.has(t)) {
|
|
14
14
|
let e = null;
|
|
15
15
|
try {
|
|
@@ -20,57 +20,66 @@ function m(t, n) {
|
|
|
20
20
|
}
|
|
21
21
|
return u.get(t)?.select(n) ?? "other";
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function h(t) {
|
|
24
24
|
const n = typeof t == "number" ? t : typeof t == "string" && t.trim() !== "" ? Number(t) : Number.NaN;
|
|
25
25
|
return Number.isFinite(n) ? n : null;
|
|
26
26
|
}
|
|
27
27
|
function i(t, n) {
|
|
28
28
|
return Object.prototype.hasOwnProperty.call(t, n) ? t[n] : void 0;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function m(t, n) {
|
|
31
31
|
return n ? t.replace(
|
|
32
32
|
/\{(\w+)\}/g,
|
|
33
33
|
(e, r) => Object.prototype.hasOwnProperty.call(n, r) && n[r] != null ? String(n[r]) : e
|
|
34
34
|
) : t;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
const r =
|
|
36
|
+
function C(t, n, e) {
|
|
37
|
+
const r = S(t), s = c[r];
|
|
38
38
|
let o = i(s, n);
|
|
39
39
|
if (o === void 0) {
|
|
40
|
-
const f =
|
|
41
|
-
o = i(s, `${n}_${
|
|
40
|
+
const f = h(e?.count), a = f === null ? "other" : _(r, f);
|
|
41
|
+
o = i(s, `${n}_${a}`) ?? i(s, `${n}_other`);
|
|
42
42
|
}
|
|
43
|
-
return o === void 0 ? String(n) :
|
|
43
|
+
return o === void 0 ? String(n) : m(o, e);
|
|
44
44
|
}
|
|
45
45
|
function l(t) {
|
|
46
46
|
return typeof t != "string" ? !1 : i(c.en, t) !== void 0 || i(c.en, `${t}_other`) !== void 0;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function I(t) {
|
|
49
49
|
return typeof t == "string" && t.startsWith("identifier_") ? "warning.identifier" : t === "invisible_chars" ? "warning.invisible_chars" : "warning.other";
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function d(t) {
|
|
52
52
|
const n = `confirm.${t}`;
|
|
53
53
|
return t !== "title" && t !== "submit" && t !== "other" && l(n) ? n : "confirm.other";
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function T(t) {
|
|
56
56
|
const n = `note.${t}`;
|
|
57
57
|
return l(n) ? n : null;
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
return
|
|
59
|
+
function E(t) {
|
|
60
|
+
return p.includes(t) ? `notification.${t}` : null;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
const n =
|
|
62
|
+
function $(t) {
|
|
63
|
+
const n = E(t.code);
|
|
64
|
+
return n === "notification.category_topic" && typeof t.articleId == "string" && t.articleId !== "" ? "notification.category_topic.article" : n;
|
|
65
|
+
}
|
|
66
|
+
function K(t) {
|
|
67
|
+
const n = typeof t == "string" ? M.indexOf(t) : -1;
|
|
64
68
|
return n < 0 ? null : `trust.${n}`;
|
|
65
69
|
}
|
|
70
|
+
function v(t) {
|
|
71
|
+
return typeof t == "string" && O.includes(t) ? `adverseOutcome.${t}` : null;
|
|
72
|
+
}
|
|
66
73
|
export {
|
|
67
74
|
c as COMMUNITY_MESSAGES,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
75
|
+
v as adverseOutcomeMessageKey,
|
|
76
|
+
C as communityMessage,
|
|
77
|
+
S as communityMessageLanguage,
|
|
78
|
+
d as confirmMessageKey,
|
|
71
79
|
l as hasCommunityMessage,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
80
|
+
T as noteMessageKey,
|
|
81
|
+
$ as notificationItemMessageKey,
|
|
82
|
+
E as notificationMessageKey,
|
|
83
|
+
K as trustLabelMessageKey,
|
|
84
|
+
I as warningMessageKey
|
|
76
85
|
};
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
*
|
|
12
12
|
* Browser-safe and server-safe: no I/O, no globals.
|
|
13
13
|
*/
|
|
14
|
-
import type { KnownNeed } from './shapes.js';
|
|
14
|
+
import type { BrakeSurface, KnownNeed } from './shapes.js';
|
|
15
15
|
/** The codes a page can be told. */
|
|
16
|
-
export declare const COMMUNITY_UI_CODES: readonly ["method", "origin", "unavailable", "invalid", "signIn", "onboarding", "age", "name", "handle", "restricted", "suspended", "terminated", "links", "fast", "blocked", "confirm", "removed", "quota", "captcha", "notFound", "surfaceOff", "notMoved", "ledger", "readOnly", "braked", "mentionLimit", "pushRefused", "realtimeOff", "submit"];
|
|
16
|
+
export declare const COMMUNITY_UI_CODES: readonly ["method", "origin", "unavailable", "invalid", "signIn", "onboarding", "age", "name", "handle", "restricted", "suspended", "terminated", "links", "fast", "blocked", "confirm", "removed", "quota", "captcha", "notFound", "surfaceOff", "notMoved", "ledger", "readOnly", "braked", "mentionLimit", "pushRefused", "realtimeOff", "membersOnly", "topicLocked", "topicCreationClosed", "followLimit", "submit"];
|
|
17
17
|
export type CommunityUiCode = (typeof COMMUNITY_UI_CODES)[number];
|
|
18
18
|
/** True for one of COMMUNITY_UI_CODES. */
|
|
19
19
|
export declare function isCommunityUiCode(code: unknown): code is CommunityUiCode;
|
|
@@ -29,6 +29,11 @@ export interface CommunityFailure {
|
|
|
29
29
|
codes?: string[];
|
|
30
30
|
/** POSTING_RESTRICTED, ACCOUNT_SUSPENDED, MODULE_READ_ONLY, BRAKED: when it ends (absent: no end set). */
|
|
31
31
|
until?: string;
|
|
32
|
+
/**
|
|
33
|
+
* M3 (m3-contracts.md §1.2, §4.9): BRAKED by ONE surface's brake — `forum` or `article_discussions` (an open set):
|
|
34
|
+
* that surface is paused and the other one works. Absent on BRAKED: the module's brake, which pauses both.
|
|
35
|
+
*/
|
|
36
|
+
surface?: BrakeSurface;
|
|
32
37
|
/** VALIDATION: the paths of the refused fields (`displayName`, `body`, …), never their values. */
|
|
33
38
|
fields?: string[];
|
|
34
39
|
/**
|
|
@@ -46,7 +51,7 @@ export type CommunityOutcome<T> = {
|
|
|
46
51
|
* Every code kb-api's community routers answer: their own, and the member, trust and quota codes they pass
|
|
47
52
|
* through. A copy of `COMMUNITY_API_CODES` in kb-api's `routes/community-codes.ts`, in its order.
|
|
48
53
|
*/
|
|
49
|
-
export declare const COMMUNITY_API_CODES: readonly ["SURFACE_OFF", "CUTOVER_NOT_MOVED", "NOT_FOUND", "ONBOARDING_REQUIRED", "AGE_BELOW_MINIMUM", "NAME_RESERVED", "NAME_BLOCKED", "HANDLE_TAKEN", "HANDLE_RATE", "POSTING_RESTRICTED", "ACCOUNT_SUSPENDED", "ACCOUNT_TERMINATED", "TOO_MANY_LINKS", "TOO_FAST", "FILTER_BLOCKED", "CONFIRMATION_REQUIRED", "MESSAGE_REMOVED", "REACTION_NOT_ALLOWED", "CAPTCHA_FAILED", "UNAUTHORIZED", "VALIDATION", "UNAVAILABLE", "STALE_LEASE", "STAFF_POSTING_OFF", "PRESET_CONFLICT", "INTERNAL", "MODULE_DARK", "MODULE_READ_ONLY", "BRAKED", "BRAKE_PLATFORM", "MODULE_CONDITIONS", "TRUST_LEVEL_INVALID", "MENTION_LIMIT", "DIGEST_UNSUBSCRIBE_INVALID", "PUSH_ENDPOINT_REFUSED", "PUSH_LIMIT", "REALTIME_OFF", "BUSY", "BRAKE_KIND_MISMATCH", "NOT_A_MEMBER_SESSION", "IDENTITY_NOT_ADMITTED", "ACCOUNT_NOT_ELIGIBLE", "MEMBER_READ_ONLY", "MEMBER_DELETION_REQUESTED", "PRIVATE_SPACE", "WRONG_PROVIDER", "CASE_CLOSED", "NOTIFIER_NOT_ALLOWED", "UNSUPPORTED_RESTRICTION", "LADDER_EXCEEDED", "PERSON_REQUIRED", "APPEAL_OPEN", "APPEAL_WINDOW_CLOSED", "APPEAL_NEEDS_ANOTHER_PERSON", "GAG_PLATFORM_ONLY", "ORDER_FINAL", "BODY_JSON_INVALID", "AUDIT_DETAIL_NOT_CODE", "LEDGER_UNAVAILABLE", "INVALID_INPUT", "LEGAL_HOLD", "TEXT_MISSING", "AGE16_NOT_ALLOWED", "QUOTA_DAILY", "QUOTA_IP_HOURLY"];
|
|
54
|
+
export declare const COMMUNITY_API_CODES: readonly ["SURFACE_OFF", "CUTOVER_NOT_MOVED", "NOT_FOUND", "ONBOARDING_REQUIRED", "AGE_BELOW_MINIMUM", "NAME_RESERVED", "NAME_BLOCKED", "HANDLE_TAKEN", "HANDLE_RATE", "POSTING_RESTRICTED", "ACCOUNT_SUSPENDED", "ACCOUNT_TERMINATED", "TOO_MANY_LINKS", "TOO_FAST", "FILTER_BLOCKED", "CONFIRMATION_REQUIRED", "MESSAGE_REMOVED", "REACTION_NOT_ALLOWED", "CAPTCHA_FAILED", "UNAUTHORIZED", "VALIDATION", "UNAVAILABLE", "STALE_LEASE", "STAFF_POSTING_OFF", "PRESET_CONFLICT", "INTERNAL", "MODULE_DARK", "MODULE_READ_ONLY", "BRAKED", "BRAKE_PLATFORM", "MODULE_CONDITIONS", "TRUST_LEVEL_INVALID", "MENTION_LIMIT", "DIGEST_UNSUBSCRIBE_INVALID", "PUSH_ENDPOINT_REFUSED", "PUSH_LIMIT", "REALTIME_OFF", "BUSY", "BRAKE_KIND_MISMATCH", "MEMBERS_ONLY", "TOPIC_LOCKED", "TOPIC_CREATION_CLOSED", "BRAND_RESTRICTED", "CATEGORY_NOT_EMPTY", "SLUG_TAKEN", "MODERATOR_NOT_ELIGIBLE", "FOLLOW_LIMIT", "STALE_REVISION", "CASE_UNDECIDED", "NOT_A_MEMBER_SESSION", "IDENTITY_NOT_ADMITTED", "ACCOUNT_NOT_ELIGIBLE", "MEMBER_READ_ONLY", "MEMBER_DELETION_REQUESTED", "PRIVATE_SPACE", "WRONG_PROVIDER", "CASE_CLOSED", "NOTIFIER_NOT_ALLOWED", "UNSUPPORTED_RESTRICTION", "LADDER_EXCEEDED", "PERSON_REQUIRED", "APPEAL_OPEN", "APPEAL_WINDOW_CLOSED", "APPEAL_NEEDS_ANOTHER_PERSON", "GAG_PLATFORM_ONLY", "ORDER_FINAL", "BODY_JSON_INVALID", "AUDIT_DETAIL_NOT_CODE", "LEDGER_UNAVAILABLE", "INVALID_INPUT", "LEGAL_HOLD", "TEXT_MISSING", "AGE16_NOT_ALLOWED", "QUOTA_DAILY", "QUOTA_IP_HOURLY"];
|
|
50
55
|
/** A code kb-api's community routers answer. */
|
|
51
56
|
export type CommunityApiCode = (typeof COMMUNITY_API_CODES)[number];
|
|
52
57
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const t = [
|
|
2
2
|
/** The host refused the method (a programming error: every operation is a POST). */
|
|
3
3
|
"method",
|
|
4
4
|
/** The host refused the request's origin (the page and its API are on different sites). */
|
|
@@ -55,9 +55,20 @@ const T = [
|
|
|
55
55
|
"pushRefused",
|
|
56
56
|
/** M2 T5: live updates are not on here: the discussion keeps itself fresh by polling (pollDiscussionHead). */
|
|
57
57
|
"realtimeOff",
|
|
58
|
+
/**
|
|
59
|
+
* M3: the forum is for the community's members — sign in, or finish joining (`needs` says what is missing for a
|
|
60
|
+
* member session that has not finished onboarding; absent for a visitor: offer the sign-in).
|
|
61
|
+
*/
|
|
62
|
+
"membersOnly",
|
|
63
|
+
/** M3: the topic is closed (locked or archived): it takes no new message, and its messages no edit. */
|
|
64
|
+
"topicLocked",
|
|
65
|
+
/** M3: no new topic can be opened in this category (the article discussions' category, or the team's alone). */
|
|
66
|
+
"topicCreationClosed",
|
|
67
|
+
/** M3: the member follows as much as one member may (COMMUNITY_FOLLOWS_MAX): unfollow something first. */
|
|
68
|
+
"followLimit",
|
|
58
69
|
/** Anything else: "that did not work, try again". */
|
|
59
70
|
"submit"
|
|
60
|
-
], D = new Set(
|
|
71
|
+
], D = new Set(t);
|
|
61
72
|
function e(E) {
|
|
62
73
|
return typeof E == "string" && D.has(E);
|
|
63
74
|
}
|
|
@@ -101,6 +112,16 @@ const r = [
|
|
|
101
112
|
"REALTIME_OFF",
|
|
102
113
|
"BUSY",
|
|
103
114
|
"BRAKE_KIND_MISMATCH",
|
|
115
|
+
"MEMBERS_ONLY",
|
|
116
|
+
"TOPIC_LOCKED",
|
|
117
|
+
"TOPIC_CREATION_CLOSED",
|
|
118
|
+
"BRAND_RESTRICTED",
|
|
119
|
+
"CATEGORY_NOT_EMPTY",
|
|
120
|
+
"SLUG_TAKEN",
|
|
121
|
+
"MODERATOR_NOT_ELIGIBLE",
|
|
122
|
+
"FOLLOW_LIMIT",
|
|
123
|
+
"STALE_REVISION",
|
|
124
|
+
"CASE_UNDECIDED",
|
|
104
125
|
"NOT_A_MEMBER_SESSION",
|
|
105
126
|
"IDENTITY_NOT_ADMITTED",
|
|
106
127
|
"ACCOUNT_NOT_ELIGIBLE",
|
|
@@ -127,7 +148,7 @@ const r = [
|
|
|
127
148
|
"AGE16_NOT_ALLOWED",
|
|
128
149
|
"QUOTA_DAILY",
|
|
129
150
|
"QUOTA_IP_HOURLY"
|
|
130
|
-
],
|
|
151
|
+
], T = Object.freeze({
|
|
131
152
|
SURFACE_OFF: "surfaceOff",
|
|
132
153
|
CUTOVER_NOT_MOVED: "notMoved",
|
|
133
154
|
NOT_FOUND: "notFound",
|
|
@@ -177,6 +198,26 @@ const r = [
|
|
|
177
198
|
BUSY: "submit",
|
|
178
199
|
// M2 follow-up F3: the platform's brakes/lift found another kind of brake (no public operation produces it).
|
|
179
200
|
BRAKE_KIND_MISMATCH: "submit",
|
|
201
|
+
// M3 (m3-contracts.md §1.2): the forum is for onboarded members and the team (`needs` for a member session short of
|
|
202
|
+
// its onboarding); a closed topic; a category that takes no topic from the member; the 500 follows.
|
|
203
|
+
MEMBERS_ONLY: "membersOnly",
|
|
204
|
+
TOPIC_LOCKED: "topicLocked",
|
|
205
|
+
TOPIC_CREATION_CLOSED: "topicCreationClosed",
|
|
206
|
+
FOLLOW_LIMIT: "followLimit",
|
|
207
|
+
// M3: the team router's own (§1.2 names them the team's: the elements never meet them). `submit`, as every code no
|
|
208
|
+
// element meets (above) — not §1.2's `unavailable`, which says „try later" where nothing will change. BRAND_RESTRICTED
|
|
209
|
+
// also answers a moderator's `moderation/topics/pin` under a preset without brand reactions; the only such preset
|
|
210
|
+
// admits no member moderators, so no element meets it there either.
|
|
211
|
+
BRAND_RESTRICTED: "submit",
|
|
212
|
+
CATEGORY_NOT_EMPTY: "submit",
|
|
213
|
+
SLUG_TAKEN: "submit",
|
|
214
|
+
MODERATOR_NOT_ELIGIBLE: "submit",
|
|
215
|
+
// M3 FX (m3-contracts.md §1.2; the review of wave 1, R3, R6). STALE_REVISION: a pre-moderation review of a text the
|
|
216
|
+
// author edited since the reviewer read it (the team's premod/review, the moderator's moderation/premod/review) —
|
|
217
|
+
// nothing was written: the moderation element re-reads the item (moderation.queue), shows the new text and asks again.
|
|
218
|
+
// CASE_UNDECIDED: the team's adverse-events/close while the case's message is held by no decision (decide it first).
|
|
219
|
+
STALE_REVISION: "submit",
|
|
220
|
+
CASE_UNDECIDED: "submit",
|
|
180
221
|
// A session that is not a reader's (the team, a key) or an identity the tenant does not admit: sign in as a reader.
|
|
181
222
|
NOT_A_MEMBER_SESSION: "signIn",
|
|
182
223
|
IDENTITY_NOT_ADMITTED: "signIn",
|
|
@@ -209,50 +250,50 @@ const r = [
|
|
|
209
250
|
AGE16_NOT_ALLOWED: "submit",
|
|
210
251
|
QUOTA_DAILY: "quota",
|
|
211
252
|
QUOTA_IP_HOURLY: "quota"
|
|
212
|
-
}), S = ["METHOD", "ORIGIN", "TOO_LARGE", "INVALID_JSON"],
|
|
253
|
+
}), S = ["METHOD", "ORIGIN", "TOO_LARGE", "INVALID_JSON"], I = Object.freeze({
|
|
213
254
|
METHOD: "method",
|
|
214
255
|
ORIGIN: "origin",
|
|
215
256
|
TOO_LARGE: "invalid",
|
|
216
257
|
INVALID_JSON: "invalid"
|
|
217
|
-
}),
|
|
258
|
+
}), A = (E, O) => Object.prototype.hasOwnProperty.call(E, O);
|
|
218
259
|
function s(E) {
|
|
219
|
-
return typeof E != "string" || E === "" ? "submit" :
|
|
260
|
+
return typeof E != "string" || E === "" ? "submit" : A(T, E) ? T[E] : A(I, E) ? I[E] : "submit";
|
|
220
261
|
}
|
|
221
|
-
const
|
|
222
|
-
function
|
|
262
|
+
const N = /* @__PURE__ */ Symbol.for("@blogmcp/sdk/CommunityTransportError");
|
|
263
|
+
function L(E) {
|
|
223
264
|
return typeof E == "number" && Number.isInteger(E) && E >= 100 && E <= 599 ? E : null;
|
|
224
265
|
}
|
|
225
266
|
function i(E) {
|
|
226
267
|
return typeof E == "number" && Number.isFinite(E) && E >= 0 ? Math.ceil(E) : null;
|
|
227
268
|
}
|
|
228
|
-
class
|
|
269
|
+
class R extends Error {
|
|
229
270
|
/** The HTTP status, or null when there was no response (network, timeout). */
|
|
230
271
|
status;
|
|
231
272
|
/** Seconds to wait before retrying (`Retry-After`), or null. */
|
|
232
273
|
retryAfterS;
|
|
233
274
|
constructor(O, _ = {}) {
|
|
234
|
-
super(O), this.name = "CommunityTransportError", this.status =
|
|
275
|
+
super(O), this.name = "CommunityTransportError", this.status = L(_.status), this.retryAfterS = i(_.retryAfterS), Object.defineProperty(this, N, { value: !0 });
|
|
235
276
|
}
|
|
236
277
|
}
|
|
237
|
-
function
|
|
238
|
-
return E instanceof
|
|
278
|
+
function n(E) {
|
|
279
|
+
return E instanceof R ? !0 : E instanceof Error && E[N] === !0;
|
|
239
280
|
}
|
|
240
281
|
function u(E) {
|
|
241
|
-
return
|
|
282
|
+
return n(E) && E.retryAfterS !== null ? { ok: !1, code: "unavailable", retryAfterS: E.retryAfterS } : { ok: !1, code: "unavailable" };
|
|
242
283
|
}
|
|
243
|
-
function
|
|
284
|
+
function C(E) {
|
|
244
285
|
return E === "unavailable" || E === "submit" || E === "method" || E === "origin" || E === "invalid" || E === "ledger";
|
|
245
286
|
}
|
|
246
287
|
export {
|
|
247
288
|
r as COMMUNITY_API_CODES,
|
|
248
289
|
S as COMMUNITY_HOST_CODES,
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
290
|
+
I as COMMUNITY_OUTCOME_OF_HOST,
|
|
291
|
+
T as COMMUNITY_OUTCOME_OF_KB,
|
|
292
|
+
t as COMMUNITY_UI_CODES,
|
|
293
|
+
R as CommunityTransportError,
|
|
253
294
|
u as communityFailureOf,
|
|
254
295
|
s as communityOutcomeOf,
|
|
255
|
-
|
|
296
|
+
n as isCommunityTransportError,
|
|
256
297
|
e as isCommunityUiCode,
|
|
257
|
-
|
|
298
|
+
C as isLoggedCommunityOutcome
|
|
258
299
|
};
|
package/dist/community/poll.d.ts
CHANGED
|
@@ -8,28 +8,52 @@
|
|
|
8
8
|
* onChange: (heads) => { if (heads.some((h) => store.applyHead(h))) void refreshDiscussion(store, client, input) },
|
|
9
9
|
* })
|
|
10
10
|
* // on unmount: poller.stop()
|
|
11
|
+
*
|
|
12
|
+
* M3 (m3-contracts.md §3.2, §5.2): `pollTopicHead` polls `forum/topics/head` by the same rules, for forum topics
|
|
13
|
+
* (refreshTopic re-reads one); it stops for good on `membersOnly` too — the forum is not open to the viewer.
|
|
11
14
|
*/
|
|
12
15
|
import type { CommunityClient } from './client.js';
|
|
13
16
|
import type { CommunityFailure } from './outcome.js';
|
|
14
|
-
import type { DiscussionHead } from './shapes.js';
|
|
15
|
-
|
|
17
|
+
import type { DiscussionHead, TopicHead } from './shapes.js';
|
|
18
|
+
/** What a head poller takes, whatever it polls (the head of an article discussion, of a topic). */
|
|
19
|
+
export interface PollHeadOptions<H> {
|
|
16
20
|
/** Whether the discussion is seen now; default: the document is visible. Polls only while true. */
|
|
17
21
|
visible?: () => boolean;
|
|
18
22
|
/** Default 20 s (at least 1 s). */
|
|
19
23
|
intervalMs?: number;
|
|
20
24
|
/** The heads that differ from the previous answer (the first answer: every head). */
|
|
21
|
-
onChange(heads:
|
|
22
|
-
/**
|
|
25
|
+
onChange(heads: H[]): void;
|
|
26
|
+
/**
|
|
27
|
+
* A poll that failed; the poller goes on, slower — `surfaceOff` stops it (the surface is switched off), and for a
|
|
28
|
+
* topic `membersOnly` too (the forum is not open to the viewer).
|
|
29
|
+
*/
|
|
23
30
|
onFailure?(failure: CommunityFailure): void;
|
|
24
31
|
/** Aborting it stops the poller (the element's lifetime). */
|
|
25
32
|
signal?: AbortSignal;
|
|
26
33
|
}
|
|
34
|
+
export interface PollDiscussionHeadOptions extends PollHeadOptions<DiscussionHead> {
|
|
35
|
+
}
|
|
36
|
+
/** M3: pollTopicHead's options — `onChange` gets the topics' heads. */
|
|
37
|
+
export interface PollTopicHeadOptions extends PollHeadOptions<TopicHead> {
|
|
38
|
+
}
|
|
27
39
|
export interface DiscussionHeadPoller {
|
|
28
40
|
/** Stops for good: no timer, no listener, the request in flight aborted. */
|
|
29
41
|
stop(): void;
|
|
30
42
|
/** Polls now (the element came into view) — or when a failure's wait ends, if one runs. */
|
|
31
43
|
now(): void;
|
|
32
44
|
}
|
|
45
|
+
/** M3: pollTopicHead's poller (the same two methods). */
|
|
46
|
+
export type TopicHeadPoller = DiscussionHeadPoller;
|
|
33
47
|
export declare const POLL_INTERVAL_MS = 20000;
|
|
34
48
|
export declare const POLL_MAX_BACKOFF_MS: number;
|
|
35
49
|
export declare function pollDiscussionHead(client: Pick<CommunityClient, 'discussions'>, articleIds: readonly string[], options: PollDiscussionHeadOptions): DiscussionHeadPoller;
|
|
50
|
+
/**
|
|
51
|
+
* M3 (m3-contracts.md §3.2, §5.2): polls `forum/topics/head` while the page shows the topics — pollDiscussionHead's
|
|
52
|
+
* rules over up to COMMUNITY_HEAD_TOPICS_MAX conversation ids. A topic the viewer may not see is left out of the
|
|
53
|
+
* answer (never refused one by one); `surfaceOff` (the forum switched off) and `membersOnly` stop the poller.
|
|
54
|
+
*
|
|
55
|
+
* const poller = pollTopicHead(client, [conversationId], {
|
|
56
|
+
* onChange: (heads) => { if (heads.some((h) => store.applyHead(h))) void refreshTopic(store, client, input) },
|
|
57
|
+
* })
|
|
58
|
+
*/
|
|
59
|
+
export declare function pollTopicHead(client: Pick<CommunityClient, 'forum'>, conversationIds: readonly string[], options: PollTopicHeadOptions): TopicHeadPoller;
|