@blogmcp/sdk 0.10.0 → 0.11.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 +129 -2
- package/dist/community/client.js +231 -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 +160 -1
- package/dist/community/messages.cs.js +178 -1
- package/dist/community/messages.d.ts +19 -1
- package/dist/community/messages.en.d.ts +150 -1
- package/dist/community/messages.en.js +161 -1
- package/dist/community/messages.js +37 -28
- package/dist/community/outcome.d.ts +8 -3
- package/dist/community/outcome.js +64 -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 +634 -7
- package/dist/community/shapes.js +92 -61
- package/dist/community/store.d.ts +15 -0
- package/dist/community/store.js +65 -61
- package/dist/community/topic.d.ts +173 -0
- package/dist/community/topic.js +225 -0
- package/package.json +3 -3
- package/src/community/channels.ts +3 -2
- package/src/community/client.ts +209 -5
- 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 +179 -1
- package/src/community/messages.en.ts +162 -1
- package/src/community/messages.ts +25 -2
- package/src/community/outcome.ts +50 -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 +662 -6
- package/src/community/store.ts +11 -5
- package/src/community/topic.ts +521 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* What the community's operations answer (docs/internal/m1-contracts.md §7.3, §7.4, §7.7, §8.3) — the shapes of
|
|
3
|
-
* kb-api's `routes/community-public.ts` and `routes/trust-notices.ts`, as types.
|
|
3
|
+
* kb-api's `routes/community-public.ts` and `routes/trust-notices.ts`, as types. M3 (m3-contracts.md §3.2–§3.5,
|
|
4
|
+
* §5.2): the forum's categories, topics, search, follows and a category moderator's queue and package.
|
|
4
5
|
*
|
|
5
6
|
* The enums a newer kb-api may extend are OPEN (community.md §3.7: the client is shaped so later surfaces add on
|
|
6
7
|
* without breaking it): a message's `state`, an author's `kind`, a `need`, a restriction's `kind` and a
|
|
@@ -31,7 +32,7 @@ export type KnownRestrictionKind = (typeof RESTRICTION_KINDS)[number];
|
|
|
31
32
|
export type RestrictionKind = Open<KnownRestrictionKind>;
|
|
32
33
|
export declare const isKnownRestrictionKind: (kind: unknown) => kind is KnownRestrictionKind;
|
|
33
34
|
/** In-app notifications: codes and ids only (`appeal_resolved` is a decision that supersedes another). */
|
|
34
|
-
export declare const NOTIFICATION_CODES: readonly ["decision", "appeal_resolved", "erasure_scheduled", "inactivity_warning", "module_read_only", "module_braked", "reply", "mention", "module_push_reset", "age_limit_changed"];
|
|
35
|
+
export declare const NOTIFICATION_CODES: readonly ["decision", "appeal_resolved", "erasure_scheduled", "inactivity_warning", "module_read_only", "module_braked", "reply", "mention", "module_push_reset", "age_limit_changed", "topic_update", "category_topic"];
|
|
35
36
|
export type KnownNotificationCode = (typeof NOTIFICATION_CODES)[number];
|
|
36
37
|
export type NotificationCode = Open<KnownNotificationCode>;
|
|
37
38
|
export declare const isKnownNotificationCode: (code: unknown) => code is KnownNotificationCode;
|
|
@@ -49,6 +50,22 @@ export type CaseCategory = (typeof CASE_CATEGORIES)[number];
|
|
|
49
50
|
export declare const isCaseCategory: (value: unknown) => value is CaseCategory;
|
|
50
51
|
/** The one category whose notice never carries a notifier's name or e-mail (kb-api: NOTIFIER_NOT_ALLOWED). */
|
|
51
52
|
export declare const CATEGORY_WITHOUT_NOTIFIER: CaseCategory;
|
|
53
|
+
/**
|
|
54
|
+
* The categories of the illegal line — every report category but the rules line's four (`rules`, `adverse_event`,
|
|
55
|
+
* `third_party_health_data`, `suspected_minor`: kb-api's `lineOf`, which test/community/codes-drift.spec.ts reads) — in
|
|
56
|
+
* CASE_CATEGORIES' order: what a category moderator escalates to the team (`moderation/escalate`, m3-contracts.md §3.4;
|
|
57
|
+
* D-M3-6 „illegal-line cases escalate only").
|
|
58
|
+
*/
|
|
59
|
+
export declare const ESCALATION_CATEGORIES: readonly CaseCategory[];
|
|
60
|
+
/**
|
|
61
|
+
* M3 (m3-contracts.md §3.5, §4.7, D-M3-10): what the team recorded on an adverse-event case — `recorded` (in its
|
|
62
|
+
* register), `reported_to_authority`, `not_adverse` (kb-api's ADVERSE_EVENT_OUTCOMES, pinned by codes-drift). Open: an
|
|
63
|
+
* outcome a newer kb-api adds reads as none (show the case's status alone).
|
|
64
|
+
*/
|
|
65
|
+
export declare const ADVERSE_EVENT_OUTCOMES: readonly ["recorded", "reported_to_authority", "not_adverse"];
|
|
66
|
+
export type KnownAdverseEventOutcome = (typeof ADVERSE_EVENT_OUTCOMES)[number];
|
|
67
|
+
export type AdverseEventOutcome = Open<KnownAdverseEventOutcome>;
|
|
68
|
+
export declare const isKnownAdverseEventOutcome: (outcome: unknown) => outcome is KnownAdverseEventOutcome;
|
|
52
69
|
export declare const AGE_BANDS: readonly ["16_17", "18_plus"];
|
|
53
70
|
export type AgeBand = (typeof AGE_BANDS)[number];
|
|
54
71
|
export declare const LEGAL_TEXT_KINDS: readonly ["rules", "terms", "privacy", "art9_consent"];
|
|
@@ -61,6 +78,11 @@ export interface MemberAuthor {
|
|
|
61
78
|
readonly displayName: string;
|
|
62
79
|
readonly avatarPreset: string | null;
|
|
63
80
|
readonly deleted?: undefined;
|
|
81
|
+
/**
|
|
82
|
+
* M3 (m3-contracts.md §3.5, §4.5): `true` on a member's message in a topic of a category the member moderates now —
|
|
83
|
+
* show „Moderátor" (`role.moderator`) beside it there, and nowhere else. Absent otherwise (and from an older kb-api).
|
|
84
|
+
*/
|
|
85
|
+
readonly moderator?: true;
|
|
64
86
|
}
|
|
65
87
|
/** An erased member, a member without a profile, and every placeholder: the author is not told. */
|
|
66
88
|
export interface DeletedMemberAuthor {
|
|
@@ -136,6 +158,12 @@ export interface PublicMessage {
|
|
|
136
158
|
* nothing is being reviewed, the author's consent releases it.
|
|
137
159
|
*/
|
|
138
160
|
readonly hiddenUntilConsent?: boolean;
|
|
161
|
+
/**
|
|
162
|
+
* M3 (m3-contracts.md §4.2): `true` on the author's OWN message that waits in a category's pre-moderation queue —
|
|
163
|
+
* its `state` is then `held` („čeká na kontrolu", `state.held`). Nothing was restricted: an approval publishes it
|
|
164
|
+
* without a statement, a rejection is a decision with one. Never on anyone else's row: others see nothing of it.
|
|
165
|
+
*/
|
|
166
|
+
readonly premoderated?: boolean;
|
|
139
167
|
/** On a top-level message: its replies, oldest first. */
|
|
140
168
|
readonly replies: readonly PublicMessage[];
|
|
141
169
|
/** On a top-level message with more replies than COMMUNITY_REPLIES_MAX. */
|
|
@@ -189,6 +217,8 @@ export interface WriteAnswer {
|
|
|
189
217
|
readonly message: PublicMessage;
|
|
190
218
|
/** The codes that hit with action `warn` (the message is visible). */
|
|
191
219
|
readonly warnings: readonly string[];
|
|
220
|
+
/** M3: `messages/edit` with a `title` (a topic's opening post): the topic with its new title. */
|
|
221
|
+
readonly topic?: Topic;
|
|
192
222
|
}
|
|
193
223
|
/** A reaction's target: the article, or one message. */
|
|
194
224
|
export type ReactionTarget = {
|
|
@@ -215,6 +245,13 @@ export interface PublicProfile {
|
|
|
215
245
|
* (no level is computed then).
|
|
216
246
|
*/
|
|
217
247
|
readonly trustLabel?: TrustLabel;
|
|
248
|
+
/**
|
|
249
|
+
* M3 (m3-contracts.md §3.5, §4.5): the listed categories the member moderates now — appointments that act now (TL3,
|
|
250
|
+
* a preset that admits member moderators); „Moderátor" (`role.moderator`) on the profile names an appointment, never
|
|
251
|
+
* a trust level (D-M3-7). kb-api sends it only to a viewer the forum admits (an onboarded member, the team at the
|
|
252
|
+
* keyboard): absent for anyone else, and from a kb-api older than M3 — so its absence says nothing.
|
|
253
|
+
*/
|
|
254
|
+
readonly moderates?: readonly ForumCategoryRef[];
|
|
218
255
|
}
|
|
219
256
|
/** The member's own profile (MyState, `me/profile/update`). */
|
|
220
257
|
export interface OwnProfile {
|
|
@@ -248,6 +285,45 @@ export interface ModuleInfo {
|
|
|
248
285
|
readonly notifications: boolean;
|
|
249
286
|
readonly profiles: boolean;
|
|
250
287
|
};
|
|
288
|
+
/**
|
|
289
|
+
* M3 (m3-contracts.md §3.5, §4.9): each public surface's switch and its own brake (beside the module's `brake`, which
|
|
290
|
+
* stops both). Absent from a kb-api older than M3 — read it through surfaceInfoOf.
|
|
291
|
+
*/
|
|
292
|
+
readonly surfaces?: ModuleSurfaces;
|
|
293
|
+
/**
|
|
294
|
+
* M3 (§4.8, D-M3-9): the team's away mode („nepřítomen") until when, or null — new topics wait for review meanwhile
|
|
295
|
+
* (`state.away`). Absent from a kb-api older than M3 — read it through communityAwayOf.
|
|
296
|
+
*/
|
|
297
|
+
readonly away?: CommunityAway | null;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* The brake of one surface (M3 §2.3, §4.9): set by the team (≤ 24 h, `tenant`) or by the automatic brake (`auto`); it
|
|
301
|
+
* always ends (`until`, the database's CHECK). It pauses that surface's member writes only — the other surface works
|
|
302
|
+
* (BRAKED `{ surface }`, brakedSurfaceOf) — while the module's own `brake` pauses both.
|
|
303
|
+
*/
|
|
304
|
+
export interface SurfaceBrake {
|
|
305
|
+
/** `tenant` | `auto` (an open set). */
|
|
306
|
+
readonly kind: string;
|
|
307
|
+
readonly until: string;
|
|
308
|
+
readonly reasonCode: string;
|
|
309
|
+
}
|
|
310
|
+
/** One surface as `me/get` reports it (M3 §3.5): switched on, and its brake in effect (null: none). */
|
|
311
|
+
export interface SurfaceInfo {
|
|
312
|
+
readonly enabled: boolean;
|
|
313
|
+
readonly brake: SurfaceBrake | null;
|
|
314
|
+
}
|
|
315
|
+
/** MyState's `module.surfaces` (M3 §3.5): the forum and the article discussions; open groups (M5a) may join. */
|
|
316
|
+
export interface ModuleSurfaces {
|
|
317
|
+
readonly forum: SurfaceInfo;
|
|
318
|
+
readonly articleDiscussions: SurfaceInfo;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* MyState's `module.away` (M3 §4.8, D-M3-9): the team is away until then (at most 14 days ahead) — new topics wait for
|
|
322
|
+
* review and every flagged message is held meanwhile; me/get carries it for anonymous viewers too. The elements say so
|
|
323
|
+
* in one sentence (`state.away`, read through communityAwayOf).
|
|
324
|
+
*/
|
|
325
|
+
export interface CommunityAway {
|
|
326
|
+
readonly until: string;
|
|
251
327
|
}
|
|
252
328
|
/**
|
|
253
329
|
* How the art. 9 consent is asked (m2-contracts.md §3.8; community.md §9.8 question 8): `joint` one consent, `split`
|
|
@@ -318,14 +394,26 @@ export interface MyState {
|
|
|
318
394
|
* Absent from a kb-api older than T10.
|
|
319
395
|
*/
|
|
320
396
|
readonly caps?: MemberCaps;
|
|
397
|
+
/**
|
|
398
|
+
* M3 (m3-contracts.md §3.5, §4.5, D-M3-6): the categories the member moderates now — active appointments that act
|
|
399
|
+
* (TL3, a preset that admits member moderators); null for everyone else. Absent from a kb-api older than M3. Read
|
|
400
|
+
* it through isCategoryModerator; the moderator's operations re-check it on every call (NOT_FOUND otherwise).
|
|
401
|
+
*/
|
|
402
|
+
readonly moderator?: ModeratorInfo | null;
|
|
403
|
+
}
|
|
404
|
+
/** MyState's `moderator` (M3): the categories the member moderates, by id. */
|
|
405
|
+
export interface ModeratorInfo {
|
|
406
|
+
readonly categoryIds: readonly string[];
|
|
321
407
|
}
|
|
322
408
|
/** MyState's `caps` (M2 T10). */
|
|
323
409
|
export interface MemberCaps {
|
|
324
410
|
readonly mentionsPerMessage: number;
|
|
325
411
|
}
|
|
326
412
|
/**
|
|
327
|
-
* The member's notification switches (m2-contracts.md §3.3): replies, mentions, topic updates (
|
|
328
|
-
*
|
|
413
|
+
* The member's notification switches (m2-contracts.md §3.3): replies, mentions, topic updates, push (the master
|
|
414
|
+
* switch), the daily e-mail digest, the night's quiet hours for push (22–7, the site's time). M3 (m3-contracts.md §4.3,
|
|
415
|
+
* D-M3-4): `notifyTopic` switches `topic_update` and `category_topic`, and is on for a member who never set it (a
|
|
416
|
+
* follow is the opt-in); a switch the member saved keeps its value.
|
|
329
417
|
*/
|
|
330
418
|
export interface MemberSettings {
|
|
331
419
|
readonly notifyReply: boolean;
|
|
@@ -417,6 +505,8 @@ export interface NotificationListInput {
|
|
|
417
505
|
readonly unreadOnly?: boolean;
|
|
418
506
|
readonly codes?: readonly string[];
|
|
419
507
|
}
|
|
508
|
+
/** M3 FX (R20): what a notification row's conversation is (an open enum: a newer kb-api may name another kind). */
|
|
509
|
+
export type NotificationConversationKind = 'topic' | 'article' | (string & {});
|
|
420
510
|
export interface NotificationItem {
|
|
421
511
|
readonly id: string;
|
|
422
512
|
readonly code: NotificationCode;
|
|
@@ -426,10 +516,20 @@ export interface NotificationItem {
|
|
|
426
516
|
/**
|
|
427
517
|
* M2 T10: the article of the conversation a `reply` or `mention` row is about, else null (absent from a kb-api
|
|
428
518
|
* older than T10). With `articleSlug` and `seq`, a page links the message on the article (communityMessageLink).
|
|
519
|
+
* M3 F3: also a `topic_update` of a followed article discussion and a `category_topic` of the „Články" category (a
|
|
520
|
+
* discussion new to its listing); a topic's row names no article — its link is `conversationId` (topicPath). Null too
|
|
521
|
+
* while the article is not readable at the viewer's level.
|
|
429
522
|
*/
|
|
430
523
|
readonly articleId?: string | null;
|
|
431
524
|
/** M2 T10: that article's slug (never its title), else null; absent from a kb-api older than T10. */
|
|
432
525
|
readonly articleSlug?: string | null;
|
|
526
|
+
/**
|
|
527
|
+
* M3 FX (the review of wave 1, R20): the kind of the row's conversation — `topic` (link a `reply`, `mention` or
|
|
528
|
+
* `topic_update` with topicMessageLink, a `category_topic` with topicPath) or `article` (its article's page while
|
|
529
|
+
* `articleId` names it; one no longer readable is still an article's row, never a topic's) —, null for a row of no
|
|
530
|
+
* public conversation (a decision, a notice of the module). Absent from a kb-api older than M3's FX.
|
|
531
|
+
*/
|
|
532
|
+
readonly conversationKind?: NotificationConversationKind | null;
|
|
433
533
|
readonly caseId: string | null;
|
|
434
534
|
readonly decisionId: string | null;
|
|
435
535
|
readonly createdAt: string;
|
|
@@ -506,7 +606,14 @@ export interface ReportItem {
|
|
|
506
606
|
readonly category: string;
|
|
507
607
|
readonly status: string;
|
|
508
608
|
readonly reportedAt: string;
|
|
609
|
+
/** The last decision's time; M3: a case closed by an adverse-event outcome alone takes the outcome's (§3.5). */
|
|
509
610
|
readonly decidedAt: string | null;
|
|
611
|
+
/**
|
|
612
|
+
* M3 (m3-contracts.md §3.5, §4.7): an adverse-event case's outcome once the team recorded one (ADVERSE_EVENT_OUTCOMES,
|
|
613
|
+
* an open set), else null — the member reporter learns the result here, as M1 tells it a decision (adverseOutcome.<…>).
|
|
614
|
+
* Absent from a kb-api older than M3.
|
|
615
|
+
*/
|
|
616
|
+
readonly outcome?: AdverseEventOutcome | null;
|
|
510
617
|
}
|
|
511
618
|
/** `legal/current`: the tenant's current text of a kind. */
|
|
512
619
|
export interface CurrentLegalText {
|
|
@@ -594,9 +701,18 @@ export interface NoticeStatus {
|
|
|
594
701
|
readonly status: 'open' | 'decided' | 'appealed' | 'closed' | (string & {});
|
|
595
702
|
readonly category: CaseCategory;
|
|
596
703
|
readonly submittedAt: string;
|
|
704
|
+
/** The last decision's time; M3: a case closed by an adverse-event outcome alone takes the outcome's (§3.5). */
|
|
597
705
|
readonly decidedAt: string | null;
|
|
598
706
|
/** The statement once decided (plain text), never the package. */
|
|
599
707
|
readonly statement: string | null;
|
|
708
|
+
/**
|
|
709
|
+
* M3 (m3-contracts.md §3.5, §4.7): an adverse-event case's outcome once the team recorded one (ADVERSE_EVENT_OUTCOMES,
|
|
710
|
+
* an open set), else null. A case closed by its outcome alone has no decision: `status` `closed`, `decidedAt` the
|
|
711
|
+
* outcome's time, `statement` null and `appeal.canAppeal` false — the page states the outcome in plain words
|
|
712
|
+
* (adverseOutcome.<…>) with the redress line (`notice.redress`), as the e-mail `notice_closed` does. Absent from a
|
|
713
|
+
* kb-api older than M3.
|
|
714
|
+
*/
|
|
715
|
+
readonly outcome?: AdverseEventOutcome | null;
|
|
600
716
|
readonly appeal: {
|
|
601
717
|
readonly canAppeal: boolean;
|
|
602
718
|
readonly closesAt: string | null;
|
|
@@ -612,10 +728,10 @@ export interface DiscussionListInput {
|
|
|
612
728
|
/** The previous page's `nextCursor`; absent for the first page. */
|
|
613
729
|
cursor?: number | null;
|
|
614
730
|
}
|
|
615
|
-
|
|
616
|
-
|
|
731
|
+
/** What every post carries, wherever it goes. */
|
|
732
|
+
export interface MessagePostFields {
|
|
617
733
|
body: string;
|
|
618
|
-
/** A reply names a top-level message of the same discussion. */
|
|
734
|
+
/** A reply names a top-level message of the same discussion or topic. */
|
|
619
735
|
replyToSeq?: number | null;
|
|
620
736
|
/** newClientMsgId(), the same on a retry. */
|
|
621
737
|
clientMsgId: string;
|
|
@@ -624,10 +740,30 @@ export interface MessagePostInput {
|
|
|
624
740
|
/** The codes of CONFIRMATION_REQUIRED the author confirmed. */
|
|
625
741
|
confirmations?: string[];
|
|
626
742
|
}
|
|
743
|
+
/** A post under an article: its discussion, by the article (created with the first message). */
|
|
744
|
+
export interface ArticleMessagePostInput extends MessagePostFields {
|
|
745
|
+
articleId: string;
|
|
746
|
+
conversationId?: never;
|
|
747
|
+
}
|
|
748
|
+
/**
|
|
749
|
+
* M3 (m3-contracts.md §3.3): a post into a forum topic, by the topic's conversation id. An article discussion is still
|
|
750
|
+
* posted to by `articleId` (Appendix B, choice 3) — kb-api refuses a `conversationId` that names one.
|
|
751
|
+
*/
|
|
752
|
+
export interface TopicMessagePostInput extends MessagePostFields {
|
|
753
|
+
conversationId: string;
|
|
754
|
+
articleId?: never;
|
|
755
|
+
}
|
|
756
|
+
/** `messages/post`: exactly one of `articleId` and `conversationId`. */
|
|
757
|
+
export type MessagePostInput = ArticleMessagePostInput | TopicMessagePostInput;
|
|
627
758
|
export interface MessageEditInput {
|
|
628
759
|
conversationId: string;
|
|
629
760
|
seq: number;
|
|
630
761
|
body: string;
|
|
762
|
+
/**
|
|
763
|
+
* M3 (§3.3): a topic's new title (≤ COMMUNITY_TOPIC_TITLE_MAX) — only on its opening post (`seq` 1) by its author,
|
|
764
|
+
* else VALIDATION on `title`. The title and the body are filtered as one text.
|
|
765
|
+
*/
|
|
766
|
+
title?: string;
|
|
631
767
|
confirmations?: string[];
|
|
632
768
|
}
|
|
633
769
|
export interface MessageReportInput {
|
|
@@ -681,4 +817,495 @@ export interface NoticeSubmitInput {
|
|
|
681
817
|
/** Must contain COMMUNITY_GOOD_FAITH. */
|
|
682
818
|
confirmations?: string[];
|
|
683
819
|
}
|
|
820
|
+
/** A category's kind: members or the team open topics in it, or it lists the article discussions (D-M3-13 „Články"). */
|
|
821
|
+
export declare const FORUM_CATEGORY_KINDS: readonly ["topics", "article_discussions"];
|
|
822
|
+
export type KnownForumCategoryKind = (typeof FORUM_CATEGORY_KINDS)[number];
|
|
823
|
+
export type ForumCategoryKind = Open<KnownForumCategoryKind>;
|
|
824
|
+
export declare const isKnownForumCategoryKind: (kind: unknown) => kind is KnownForumCategoryKind;
|
|
825
|
+
/**
|
|
826
|
+
* A category's mode (§4.1): `post` M1's pipeline, `hold_flagged` a flagged text is held, `pre` every post waits for
|
|
827
|
+
* review. The category's own mode — away mode raises it for every write meanwhile (MyState `module.away`).
|
|
828
|
+
*/
|
|
829
|
+
export declare const FORUM_CATEGORY_MODES: readonly ["post", "hold_flagged", "pre"];
|
|
830
|
+
export type KnownForumCategoryMode = (typeof FORUM_CATEGORY_MODES)[number];
|
|
831
|
+
export type ForumCategoryMode = Open<KnownForumCategoryMode>;
|
|
832
|
+
export declare const isKnownForumCategoryMode: (mode: unknown) => mode is KnownForumCategoryMode;
|
|
833
|
+
/** Who opens topics in a category: its members, or only the team (TOPIC_CREATION_CLOSED for a member). */
|
|
834
|
+
export declare const TOPIC_CREATIONS: readonly ["members", "team"];
|
|
835
|
+
export type KnownTopicCreation = (typeof TOPIC_CREATIONS)[number];
|
|
836
|
+
export type TopicCreation = Open<KnownTopicCreation>;
|
|
837
|
+
/**
|
|
838
|
+
* A topic's state (§1.1): `open`; `locked` — no new message (reading, reactions on what is there and reports go on);
|
|
839
|
+
* `archived` — locked and out of the default list. An unknown state reads as locked: offer no composer.
|
|
840
|
+
*/
|
|
841
|
+
export declare const TOPIC_STATES: readonly ["open", "locked", "archived"];
|
|
842
|
+
export type KnownTopicState = (typeof TOPIC_STATES)[number];
|
|
843
|
+
export type TopicState = Open<KnownTopicState>;
|
|
844
|
+
export declare const isKnownTopicState: (state: unknown) => state is KnownTopicState;
|
|
845
|
+
/** What one row of a category's list is: a topic, or (in the „Články" category) an article's discussion. */
|
|
846
|
+
export declare const TOPIC_ITEM_KINDS: readonly ["topic", "article"];
|
|
847
|
+
export type KnownTopicItemKind = (typeof TOPIC_ITEM_KINDS)[number];
|
|
848
|
+
export type TopicItemKind = Open<KnownTopicItemKind>;
|
|
849
|
+
/**
|
|
850
|
+
* How `forum/topics/list` orders a category (closed: kb-api validates it): by the latest activity (pinned topics
|
|
851
|
+
* first) or the newest first. There is no sort by reactions, votes or score in v1, for any tenant (§4.6).
|
|
852
|
+
*/
|
|
853
|
+
export declare const FORUM_SORTS: readonly ["activity", "new"];
|
|
854
|
+
export type ForumSort = (typeof FORUM_SORTS)[number];
|
|
855
|
+
/** Where a message lives: a forum topic or an article's discussion (`forum/search`, `me/follows/list`). */
|
|
856
|
+
export declare const FORUM_SPACES: readonly ["forum", "article"];
|
|
857
|
+
export type KnownForumSpace = (typeof FORUM_SPACES)[number];
|
|
858
|
+
export type ForumSpace = Open<KnownForumSpace>;
|
|
859
|
+
/** A search hit: a topic's title, or a message. */
|
|
860
|
+
export declare const SEARCH_RESULT_KINDS: readonly ["topic", "message"];
|
|
861
|
+
export type KnownSearchResultKind = (typeof SEARCH_RESULT_KINDS)[number];
|
|
862
|
+
export type SearchResultKind = Open<KnownSearchResultKind>;
|
|
863
|
+
/** What a member follows: a conversation (a topic or an article discussion) or a category. */
|
|
864
|
+
export declare const FOLLOW_TARGET_KINDS: readonly ["conversation", "category"];
|
|
865
|
+
export type KnownFollowTargetKind = (typeof FOLLOW_TARGET_KINDS)[number];
|
|
866
|
+
export type FollowTargetKind = Open<KnownFollowTargetKind>;
|
|
867
|
+
/**
|
|
868
|
+
* The surface a BRAKED refusal names (M3 §1.2, §4.9): its own brake stopped the write — the other surface works.
|
|
869
|
+
* Absent from the refusal: the module's brake, which stops both. Open: open groups (M5a) will be a third.
|
|
870
|
+
*/
|
|
871
|
+
export declare const BRAKE_SURFACES: readonly ["forum", "article_discussions"];
|
|
872
|
+
export type KnownBrakeSurface = (typeof BRAKE_SURFACES)[number];
|
|
873
|
+
export type BrakeSurface = Open<KnownBrakeSurface>;
|
|
874
|
+
export declare const isKnownBrakeSurface: (surface: unknown) => surface is KnownBrakeSurface;
|
|
875
|
+
/** A moderator's queue row: an open case, or a message waiting in pre-moderation. */
|
|
876
|
+
export declare const MODERATION_ITEM_KINDS: readonly ["case", "premod"];
|
|
877
|
+
export type KnownModerationItemKind = (typeof MODERATION_ITEM_KINDS)[number];
|
|
878
|
+
export type ModerationItemKind = Open<KnownModerationItemKind>;
|
|
879
|
+
/**
|
|
880
|
+
* A queued case's status (§3.4): `open`, or `decided` — a case a `system` decision already decided that still holds
|
|
881
|
+
* its message (a filter hold is decided at birth; the moderator restores or removes it). Open: a status a newer kb-api
|
|
882
|
+
* adds reads as `open`.
|
|
883
|
+
*/
|
|
884
|
+
export declare const MODERATION_CASE_STATUSES: readonly ["open", "decided"];
|
|
885
|
+
export type KnownModerationCaseStatus = (typeof MODERATION_CASE_STATUSES)[number];
|
|
886
|
+
export type ModerationCaseStatus = Open<KnownModerationCaseStatus>;
|
|
887
|
+
/** Where a moderator's case came from (§3.4): a member's report, the filters or the provider's own initiative. */
|
|
888
|
+
export declare const MODERATION_SOURCES: readonly ["member_report", "filter", "staff"];
|
|
889
|
+
export type KnownModerationSource = (typeof MODERATION_SOURCES)[number];
|
|
890
|
+
export type ModerationSource = Open<KnownModerationSource>;
|
|
891
|
+
/** What a category moderator may decide (§4.5; closed: anything else is UNSUPPORTED_RESTRICTION). */
|
|
892
|
+
export declare const MODERATION_RESTRICTIONS: readonly ["no_action", "visibility_restricted", "removal"];
|
|
893
|
+
export type ModerationRestriction = (typeof MODERATION_RESTRICTIONS)[number];
|
|
894
|
+
/** A moderator's decision's basis: a notice (a report) or the provider's own initiative. */
|
|
895
|
+
export declare const MODERATION_BASES: readonly ["notice", "own_initiative"];
|
|
896
|
+
export type ModerationBasis = (typeof MODERATION_BASES)[number];
|
|
897
|
+
/** The states a moderator sets (archiving is the team's). */
|
|
898
|
+
export declare const MODERATOR_TOPIC_STATES: readonly ["open", "locked"];
|
|
899
|
+
export type ModeratorTopicState = (typeof MODERATOR_TOPIC_STATES)[number];
|
|
900
|
+
/** A pre-moderation review: publish (no statement), or refuse (a removal with its statement). */
|
|
901
|
+
export declare const PREMOD_OUTCOMES: readonly ["approve", "reject"];
|
|
902
|
+
export type PremodOutcome = (typeof PREMOD_OUTCOMES)[number];
|
|
903
|
+
/** A category as a topic, a profile or a follow names it. */
|
|
904
|
+
export interface ForumCategoryRef {
|
|
905
|
+
readonly slug: string;
|
|
906
|
+
readonly name: string;
|
|
907
|
+
}
|
|
908
|
+
/** `forum/categories/list`: one listed category (the team's hidden ones never reach a member). */
|
|
909
|
+
export interface ForumCategory extends ForumCategoryRef {
|
|
910
|
+
readonly id: string;
|
|
911
|
+
/** Plain text: render it as text. */
|
|
912
|
+
readonly description: string | null;
|
|
913
|
+
readonly kind: ForumCategoryKind;
|
|
914
|
+
readonly topicCreation: TopicCreation;
|
|
915
|
+
/**
|
|
916
|
+
* The category's own mode (§4.1) — null for the article discussions' category („Články"), which has none (§2.1: M1's
|
|
917
|
+
* pipeline with the preset's rules). Never away mode's raise: MyState `module.away` says that.
|
|
918
|
+
*/
|
|
919
|
+
readonly mode: ForumCategoryMode | null;
|
|
920
|
+
readonly position: number;
|
|
921
|
+
/** The topics (in „Články": the article discussions) another member sees listed (§3.1's rule). */
|
|
922
|
+
readonly topicCount: number;
|
|
923
|
+
readonly lastActivityAt: string | null;
|
|
924
|
+
/** The viewer follows the category (its new topics notify them). */
|
|
925
|
+
readonly following: boolean;
|
|
926
|
+
/**
|
|
927
|
+
* The category's moderators — the appointments that act now (TL3, a preset that admits member moderators; none under
|
|
928
|
+
* the regulated preset, and none until category moderators exist): as members' messages name them.
|
|
929
|
+
*/
|
|
930
|
+
readonly moderators: readonly Author[];
|
|
931
|
+
}
|
|
932
|
+
/** A topic's row in its category's list (a topic is listed to a viewer exactly when `forum/topics/get` answers it). */
|
|
933
|
+
export interface ForumTopicItem {
|
|
934
|
+
readonly kind: 'topic';
|
|
935
|
+
readonly conversationId: string;
|
|
936
|
+
/**
|
|
937
|
+
* null when the viewer may not see it (§3.1's placeholder rule: the opening post is held, removed or held back, and a
|
|
938
|
+
* reply keeps the topic readable) and once the opening post is deleted — topicTitleOf tells the two apart by
|
|
939
|
+
* `openingState`: „Smazané téma" (`topic.deleted`) for `deleted` only, the withheld wording (`topic.withheld`)
|
|
940
|
+
* otherwise. `author` is then the placeholder author.
|
|
941
|
+
*/
|
|
942
|
+
readonly title: string | null;
|
|
943
|
+
readonly author: Author;
|
|
944
|
+
readonly state: TopicState;
|
|
945
|
+
readonly pinned: boolean;
|
|
946
|
+
/** The messages everyone is shown. */
|
|
947
|
+
readonly count: number;
|
|
948
|
+
readonly createdAt: string;
|
|
949
|
+
readonly lastActivityAt: string;
|
|
950
|
+
readonly following: boolean;
|
|
951
|
+
/**
|
|
952
|
+
* The opening post's state as the viewer sees it, whenever it is not `visible`: on the viewer's own topic `held` (also
|
|
953
|
+
* while it waits for review: „čeká na kontrolu"); on another member's topic the placeholder's state — `held`,
|
|
954
|
+
* `removed` or `deleted`. Absent when visible.
|
|
955
|
+
*/
|
|
956
|
+
readonly openingState?: MessageState;
|
|
957
|
+
}
|
|
958
|
+
/** An article's discussion in the „Články" category's list (articles the viewer may read). */
|
|
959
|
+
export interface ForumArticleItem {
|
|
960
|
+
readonly kind: 'article';
|
|
961
|
+
readonly conversationId: string;
|
|
962
|
+
readonly articleId: string;
|
|
963
|
+
/**
|
|
964
|
+
* M3 FX (the review of wave 1, R20): what the row's link needs — the article's slug (its filename without `.md`/`.mdx`),
|
|
965
|
+
* as `ForumSearchResult.articleSlug`: the host's `articlePath` filled with it (communityArticleLink).
|
|
966
|
+
*/
|
|
967
|
+
readonly articleSlug: string;
|
|
968
|
+
readonly articleTitle: string | null;
|
|
969
|
+
readonly count: number;
|
|
970
|
+
readonly lastActivityAt: string;
|
|
971
|
+
readonly following: boolean;
|
|
972
|
+
}
|
|
973
|
+
/** A row of a kind a newer kb-api added: skip it. */
|
|
974
|
+
export interface UnknownTopicItem {
|
|
975
|
+
readonly kind: string & {};
|
|
976
|
+
}
|
|
977
|
+
export type KnownTopicItem = ForumTopicItem | ForumArticleItem;
|
|
978
|
+
export type TopicItem = KnownTopicItem | UnknownTopicItem;
|
|
979
|
+
/** `forum/topics/list`: one keyset page of a category (the cursor is opaque). */
|
|
980
|
+
export interface ForumTopicsPage {
|
|
981
|
+
readonly category: {
|
|
982
|
+
readonly id: string;
|
|
983
|
+
readonly slug: string;
|
|
984
|
+
readonly name: string;
|
|
985
|
+
readonly kind: ForumCategoryKind;
|
|
986
|
+
};
|
|
987
|
+
readonly items: readonly TopicItem[];
|
|
988
|
+
readonly nextCursor: string | null;
|
|
989
|
+
}
|
|
990
|
+
/** A topic's header (`forum/topics/get`, a new topic, a title edit, a moderator's change). */
|
|
991
|
+
export interface Topic {
|
|
992
|
+
readonly conversationId: string;
|
|
993
|
+
readonly category: {
|
|
994
|
+
readonly id: string;
|
|
995
|
+
readonly slug: string;
|
|
996
|
+
readonly name: string;
|
|
997
|
+
};
|
|
998
|
+
/**
|
|
999
|
+
* null when §3.1's placeholder rule withholds it from the viewer (the opening post held, removed or held back; a
|
|
1000
|
+
* reply keeps the topic readable) and once the opening post is deleted — topicTitleOf tells the two apart by the
|
|
1001
|
+
* opening post's state. A re-read (a resync) may bring a withheld title back.
|
|
1002
|
+
*/
|
|
1003
|
+
readonly title: string | null;
|
|
1004
|
+
readonly state: TopicState;
|
|
1005
|
+
readonly pinned: boolean;
|
|
1006
|
+
readonly createdAt: string;
|
|
1007
|
+
readonly author: Author;
|
|
1008
|
+
readonly following: boolean;
|
|
1009
|
+
}
|
|
1010
|
+
/** The viewer of a topic: the discussion's viewer, and whether they moderate its category. */
|
|
1011
|
+
export interface TopicViewerState extends DiscussionViewerState {
|
|
1012
|
+
readonly moderator: boolean;
|
|
1013
|
+
}
|
|
1014
|
+
/**
|
|
1015
|
+
* `forum/topics/get`: one page of a topic — the messages, cursor, counters, reactions and preset exactly as
|
|
1016
|
+
* `discussions/list` answers them (the opening post is seq 1), with the topic's header in place of the article.
|
|
1017
|
+
*/
|
|
1018
|
+
export interface TopicThread {
|
|
1019
|
+
readonly topic: Topic;
|
|
1020
|
+
/** Top-level, oldest first, COMMUNITY_PAGE_SIZE a page. */
|
|
1021
|
+
readonly messages: readonly PublicMessage[];
|
|
1022
|
+
readonly nextCursor: number | null;
|
|
1023
|
+
readonly count: number;
|
|
1024
|
+
readonly lastSeq: number;
|
|
1025
|
+
readonly lastChangeAt: string | null;
|
|
1026
|
+
readonly reactionSet: readonly string[];
|
|
1027
|
+
readonly preset: string | null;
|
|
1028
|
+
readonly viewer: TopicViewerState;
|
|
1029
|
+
}
|
|
1030
|
+
/** `forum/topics/head`: the polling signal of one topic (an id the viewer may not see is left out). */
|
|
1031
|
+
export interface TopicHead {
|
|
1032
|
+
readonly conversationId: string;
|
|
1033
|
+
readonly count: number;
|
|
1034
|
+
readonly lastSeq: number;
|
|
1035
|
+
readonly lastChangeAt: string | null;
|
|
1036
|
+
}
|
|
1037
|
+
/**
|
|
1038
|
+
* One `forum/search` hit (§4.4): plain text only — render the title and the snippet as text. Not `SearchResult`: the
|
|
1039
|
+
* SDK's root entry exports the article search's type of that name (A34).
|
|
1040
|
+
*/
|
|
1041
|
+
export interface ForumSearchResult {
|
|
1042
|
+
readonly kind: SearchResultKind;
|
|
1043
|
+
readonly space: ForumSpace;
|
|
1044
|
+
readonly conversationId: string;
|
|
1045
|
+
/** The message's seq (a `message` hit), else null. */
|
|
1046
|
+
readonly seq: number | null;
|
|
1047
|
+
/**
|
|
1048
|
+
* The topic's title (or the article's) as the viewer may see it — null for a `message` hit in a topic whose title
|
|
1049
|
+
* §3.1's rule withholds from the viewer, or whose opening post was deleted: `openingState` tells the two apart, as on
|
|
1050
|
+
* a category's row — read a forum hit's title through topicTitleOf (`topic.deleted` „Smazané téma" for a deleted
|
|
1051
|
+
* opening post, `topic.withheld` otherwise).
|
|
1052
|
+
*/
|
|
1053
|
+
readonly title: string | null;
|
|
1054
|
+
/**
|
|
1055
|
+
* M3 FX2 (m3-contracts.md §5.3; the review of wave 2, S12): `deleted` on a `message` hit of a topic whose opening post
|
|
1056
|
+
* was deleted (its title went with it). Absent otherwise — and from a kb-api older than M3 FX2, whose deleted opening
|
|
1057
|
+
* post then reads as withheld.
|
|
1058
|
+
*/
|
|
1059
|
+
readonly openingState?: MessageState;
|
|
1060
|
+
/** A topic's category; null for an article discussion's hit. */
|
|
1061
|
+
readonly categoryId: string | null;
|
|
1062
|
+
/** An article discussion's article; null for a topic's hit. */
|
|
1063
|
+
readonly articleId: string | null;
|
|
1064
|
+
/**
|
|
1065
|
+
* M3 F3 (the wave 2 integration): what an article discussion's hit needs for its link — the article's slug (its
|
|
1066
|
+
* filename without `.md`/`.mdx`, as the notification centre names it): `communityMessageLink(articlePath, articleSlug,
|
|
1067
|
+
* seq)`. Null for a topic's hit (link it by `conversationId`: topicPath, topicMessageLink).
|
|
1068
|
+
*/
|
|
1069
|
+
readonly articleSlug: string | null;
|
|
1070
|
+
/** At most 200 characters around the first hit, no markup. */
|
|
1071
|
+
readonly snippet: string | null;
|
|
1072
|
+
readonly createdAt: string;
|
|
1073
|
+
}
|
|
1074
|
+
/** `forum/search`: one page of at most COMMUNITY_SEARCH_PAGE_SIZE hits; pages 1..COMMUNITY_SEARCH_PAGES_MAX only. */
|
|
1075
|
+
export interface ForumSearchPage {
|
|
1076
|
+
readonly results: readonly ForumSearchResult[];
|
|
1077
|
+
readonly page: number;
|
|
1078
|
+
/** false on the last page (always on page COMMUNITY_SEARCH_PAGES_MAX). */
|
|
1079
|
+
readonly hasMore: boolean;
|
|
1080
|
+
}
|
|
1081
|
+
/** What `me/follows/set` names: a conversation (a topic or an article discussion with one) or a category. */
|
|
1082
|
+
export type FollowTarget = {
|
|
1083
|
+
readonly conversationId: string;
|
|
1084
|
+
} | {
|
|
1085
|
+
readonly categoryId: string;
|
|
1086
|
+
};
|
|
1087
|
+
/** `me/follows/list`: one of the member's follows. */
|
|
1088
|
+
export interface Follow {
|
|
1089
|
+
readonly targetKind: FollowTargetKind;
|
|
1090
|
+
readonly targetId: string;
|
|
1091
|
+
/** `forum` | `article` for a conversation, null for a category. */
|
|
1092
|
+
readonly space: ForumSpace | null;
|
|
1093
|
+
/** The topic's title, the category's name or the article's title as the member may see it now, else null. */
|
|
1094
|
+
readonly title: string | null;
|
|
1095
|
+
/**
|
|
1096
|
+
* M3 F3 (the wave 2 integration): what a link needs while the member may read the target — a category's slug
|
|
1097
|
+
* (categoryPath), an article's slug (its filename without `.md`/`.mdx`: the host's articlePath); null for a topic (link
|
|
1098
|
+
* it by `targetId`: topicPath) and whenever `title` is null.
|
|
1099
|
+
*/
|
|
1100
|
+
readonly slug: string | null;
|
|
1101
|
+
readonly createdAt: string;
|
|
1102
|
+
}
|
|
1103
|
+
/** `me/follows/list`: a keyset page. */
|
|
1104
|
+
export interface FollowsPage {
|
|
1105
|
+
readonly follows: readonly Follow[];
|
|
1106
|
+
readonly nextCursor: string | null;
|
|
1107
|
+
}
|
|
1108
|
+
/**
|
|
1109
|
+
* A row of a category moderator's queue (§3.4): a case of category `rules` in the moderator's categories — open, or
|
|
1110
|
+
* decided while a `system` decision still holds its message — or a message waiting in pre-moderation (reasons
|
|
1111
|
+
* `category_pre`, `away`; a `health_third_party` item never reaches a moderator).
|
|
1112
|
+
*/
|
|
1113
|
+
export interface ModerationItem {
|
|
1114
|
+
readonly kind: ModerationItemKind;
|
|
1115
|
+
/** The case (a `case` row), else null. */
|
|
1116
|
+
readonly caseId: string | null;
|
|
1117
|
+
/** The case's status (a `case` row: `open`, or `decided` while the system's hold stands), else null. */
|
|
1118
|
+
readonly caseStatus: ModerationCaseStatus | null;
|
|
1119
|
+
readonly conversationId: string;
|
|
1120
|
+
readonly seq: number;
|
|
1121
|
+
readonly categoryId: string;
|
|
1122
|
+
/** The case's category (a `case` row), else null. */
|
|
1123
|
+
readonly caseCategory: string | null;
|
|
1124
|
+
readonly ruleId: string | null;
|
|
1125
|
+
readonly source: ModerationSource | null;
|
|
1126
|
+
readonly createdAt: string;
|
|
1127
|
+
readonly deadlineAt: string | null;
|
|
1128
|
+
/**
|
|
1129
|
+
* M3 FX (m3-contracts.md §3.4; the review of wave 1, R3): a `premod` row's message rev — `moderation.reviewPremod` takes
|
|
1130
|
+
* it back and decides that text only (an edit since answers `submit`: re-read the queue, show the new text, ask again);
|
|
1131
|
+
* null on a `case` row.
|
|
1132
|
+
*/
|
|
1133
|
+
readonly rev: number | null;
|
|
1134
|
+
/** M3 FX (R3): a `premod` row's text as written (render it as text); null on a `case` row (its package is `getCase`'s). */
|
|
1135
|
+
readonly body: string | null;
|
|
1136
|
+
/** M3 FX (R3): a `premod` row of an opening post — its topic's title (render it as text). */
|
|
1137
|
+
readonly title?: string | null;
|
|
1138
|
+
}
|
|
1139
|
+
/** `moderation/queue`: a keyset page. */
|
|
1140
|
+
export interface ModerationQueuePage {
|
|
1141
|
+
readonly items: readonly ModerationItem[];
|
|
1142
|
+
readonly nextCursor: string | null;
|
|
1143
|
+
}
|
|
1144
|
+
/**
|
|
1145
|
+
* One item of a case's package, as written (render it as text); never who reported it. The case's subject is whole
|
|
1146
|
+
* (its text, title and handle null only once it was deleted); another message of the package only while everyone may
|
|
1147
|
+
* see it now and its author has not edited it since the package was written (M3 FX2, S4) — otherwise its `body`,
|
|
1148
|
+
* `title` and `authorHandle` are null (say so: `moderation.itemWithheld`; an opening post's title through
|
|
1149
|
+
* topicTitleOf: `topic.deleted` for a deleted opening post, `topic.withheld` otherwise).
|
|
1150
|
+
*/
|
|
1151
|
+
export interface ModerationCaseItem {
|
|
1152
|
+
readonly itemNo: number;
|
|
1153
|
+
/** On an opening post's item: the topic's title — null when withheld, or cleared with a deleted opening post (`openingState`). */
|
|
1154
|
+
readonly title?: string | null;
|
|
1155
|
+
/**
|
|
1156
|
+
* M3 FX2 (S12): `deleted` on an opening post's item whose opening post was deleted — its title went with it. Absent
|
|
1157
|
+
* otherwise (and from a kb-api older than M3 FX2).
|
|
1158
|
+
*/
|
|
1159
|
+
readonly openingState?: MessageState;
|
|
1160
|
+
/** null when withheld (a message of the package other than the subject that others cannot see now). */
|
|
1161
|
+
readonly body: string | null;
|
|
1162
|
+
readonly authorHandle: string | null;
|
|
1163
|
+
/** When the message was written, as the package recorded it; null when the package holds no time. */
|
|
1164
|
+
readonly createdAt: string | null;
|
|
1165
|
+
}
|
|
1166
|
+
/** `moderation/cases/get`: the package; no reporter, no reporter's note, no notifier contact, no earlier deciders. */
|
|
1167
|
+
export interface ModerationCase {
|
|
1168
|
+
readonly id: string;
|
|
1169
|
+
readonly caseCategory: string;
|
|
1170
|
+
readonly ruleId: string | null;
|
|
1171
|
+
readonly source: ModerationSource;
|
|
1172
|
+
readonly status: string;
|
|
1173
|
+
readonly createdAt: string;
|
|
1174
|
+
readonly deadlineAt: string | null;
|
|
1175
|
+
readonly subject: {
|
|
1176
|
+
readonly conversationId: string;
|
|
1177
|
+
readonly seq: number;
|
|
1178
|
+
};
|
|
1179
|
+
readonly items: readonly ModerationCaseItem[];
|
|
1180
|
+
}
|
|
1181
|
+
/** `moderation/decide`: the statement (a dry run writes nothing) and, when decided, the decision. */
|
|
1182
|
+
export interface ModerationDecideAnswer {
|
|
1183
|
+
readonly dryRun: boolean;
|
|
1184
|
+
/** The statement of reasons as kb-api renders it (plain text). */
|
|
1185
|
+
readonly statement: string;
|
|
1186
|
+
readonly decision?: {
|
|
1187
|
+
readonly id: string;
|
|
1188
|
+
readonly restriction: ModerationRestriction | (string & {});
|
|
1189
|
+
};
|
|
1190
|
+
}
|
|
1191
|
+
/** `moderation/remove` and a rejected pre-moderated message: the removal and its statement. */
|
|
1192
|
+
export interface ModerationRemovalAnswer {
|
|
1193
|
+
readonly decision: {
|
|
1194
|
+
readonly id: string;
|
|
1195
|
+
};
|
|
1196
|
+
readonly statement: string;
|
|
1197
|
+
}
|
|
1198
|
+
/** `moderation/premod/review`: the published message (approve), or the removal with its statement (reject). */
|
|
1199
|
+
export type PremodReviewAnswer = {
|
|
1200
|
+
readonly message: PublicMessage;
|
|
1201
|
+
} | ModerationRemovalAnswer;
|
|
1202
|
+
/** `forum/topics/create`: the topic, its opening post as its author sees it, the filters' warnings. */
|
|
1203
|
+
export interface TopicCreateAnswer {
|
|
1204
|
+
readonly topic: Topic;
|
|
1205
|
+
readonly message: PublicMessage;
|
|
1206
|
+
readonly warnings: readonly string[];
|
|
1207
|
+
}
|
|
1208
|
+
/** `forum/topics/list`: a category by its id or its slug; `cursor` is the previous page's `nextCursor`. */
|
|
1209
|
+
export type ForumTopicsListInput = ({
|
|
1210
|
+
categoryId: string;
|
|
1211
|
+
categorySlug?: never;
|
|
1212
|
+
} | {
|
|
1213
|
+
categorySlug: string;
|
|
1214
|
+
categoryId?: never;
|
|
1215
|
+
}) & {
|
|
1216
|
+
sort?: ForumSort;
|
|
1217
|
+
cursor?: string | null;
|
|
1218
|
+
/** 1..COMMUNITY_TOPICS_PAGE_MAX (default COMMUNITY_TOPICS_PAGE_SIZE). */
|
|
1219
|
+
limit?: number;
|
|
1220
|
+
};
|
|
1221
|
+
export interface ForumTopicGetInput {
|
|
1222
|
+
conversationId: string;
|
|
1223
|
+
/** The page's language: a translation of each message into it when one exists. */
|
|
1224
|
+
languageCode?: string | null;
|
|
1225
|
+
/** The previous page's `nextCursor`; absent for the first page. */
|
|
1226
|
+
cursor?: number | null;
|
|
1227
|
+
}
|
|
1228
|
+
export interface ForumTopicCreateInput {
|
|
1229
|
+
categoryId: string;
|
|
1230
|
+
/** ≤ COMMUNITY_TOPIC_TITLE_MAX characters. */
|
|
1231
|
+
title: string;
|
|
1232
|
+
body: string;
|
|
1233
|
+
/** newClientMsgId(), the same on a retry (a repeat answers the topic it created). */
|
|
1234
|
+
clientMsgId: string;
|
|
1235
|
+
languageCode: string;
|
|
1236
|
+
confirmations?: string[];
|
|
1237
|
+
}
|
|
1238
|
+
export interface ForumSearchInput {
|
|
1239
|
+
/** COMMUNITY_SEARCH_QUERY_MIN..COMMUNITY_SEARCH_QUERY_MAX characters (forumSearchQueryOf). */
|
|
1240
|
+
query: string;
|
|
1241
|
+
categoryId?: string | null;
|
|
1242
|
+
space?: KnownForumSpace | null;
|
|
1243
|
+
/** 1..COMMUNITY_SEARCH_PAGES_MAX. */
|
|
1244
|
+
page?: number;
|
|
1245
|
+
}
|
|
1246
|
+
/**
|
|
1247
|
+
* `me/follows/set` (§3.3, B16): `following: true` needs a target the member may read now — anything else (a topic the
|
|
1248
|
+
* member may not see, a hidden or deleted category, an internal or discussion-free article) is the one `notFound`, so
|
|
1249
|
+
* the button says „not available"; then the `community_profile` quota and `followLimit` above COMMUNITY_FOLLOWS_MAX.
|
|
1250
|
+
* `following: false` never fails on the target (an unknown one answers `{ following: false }`): an unfollow needs no
|
|
1251
|
+
* error path of its own.
|
|
1252
|
+
*/
|
|
1253
|
+
export interface FollowSetInput {
|
|
1254
|
+
target: FollowTarget;
|
|
1255
|
+
following: boolean;
|
|
1256
|
+
}
|
|
1257
|
+
export interface ModerationQueueInput {
|
|
1258
|
+
categoryId?: string | null;
|
|
1259
|
+
cursor?: string | null;
|
|
1260
|
+
}
|
|
1261
|
+
export interface ModerationDecideInput {
|
|
1262
|
+
caseId: string;
|
|
1263
|
+
restriction: ModerationRestriction;
|
|
1264
|
+
basis: ModerationBasis;
|
|
1265
|
+
/** The facts and circumstances, as the statement will state them. */
|
|
1266
|
+
facts: string;
|
|
1267
|
+
/**
|
|
1268
|
+
* A rule id of the tenant's current rules text the restriction rests on (§3.4, A09); absent, the case's own rule id.
|
|
1269
|
+
* A restriction on a case without one and without this is `invalid` with `fields: ['contractualGround']`: ask the
|
|
1270
|
+
* moderator for the rule. `automatedDetection` is kb-api's, from the case — never an input.
|
|
1271
|
+
*/
|
|
1272
|
+
contractualGround?: string | null;
|
|
1273
|
+
locale?: string | null;
|
|
1274
|
+
/** true: render the statement and write nothing (the preview the moderator confirms). */
|
|
1275
|
+
dryRun?: boolean;
|
|
1276
|
+
}
|
|
1277
|
+
export interface ModerationRemoveInput {
|
|
1278
|
+
conversationId: string;
|
|
1279
|
+
seq: number;
|
|
1280
|
+
ruleId: string;
|
|
1281
|
+
facts: string;
|
|
1282
|
+
locale?: string | null;
|
|
1283
|
+
}
|
|
1284
|
+
export interface ModerationEscalateInput {
|
|
1285
|
+
conversationId: string;
|
|
1286
|
+
seq: number;
|
|
1287
|
+
/** One of the illegal line's case categories (never `rules`). */
|
|
1288
|
+
category: CaseCategory;
|
|
1289
|
+
}
|
|
1290
|
+
/**
|
|
1291
|
+
* `moderation/premod/review`: approve, or reject on a rule with the facts; `locale` — the statement's language (reject).
|
|
1292
|
+
* M3 FX (R3): `rev` — the queue row's (`ModerationItem.rev`): the review decides the text the moderator read.
|
|
1293
|
+
*/
|
|
1294
|
+
export type PremodReviewInput = {
|
|
1295
|
+
conversationId: string;
|
|
1296
|
+
seq: number;
|
|
1297
|
+
rev: number;
|
|
1298
|
+
outcome: 'approve';
|
|
1299
|
+
ruleId?: never;
|
|
1300
|
+
facts?: never;
|
|
1301
|
+
locale?: string | null;
|
|
1302
|
+
} | {
|
|
1303
|
+
conversationId: string;
|
|
1304
|
+
seq: number;
|
|
1305
|
+
rev: number;
|
|
1306
|
+
outcome: 'reject';
|
|
1307
|
+
ruleId: string;
|
|
1308
|
+
facts: string;
|
|
1309
|
+
locale?: string | null;
|
|
1310
|
+
};
|
|
684
1311
|
export {};
|