@adatechnology/content-contracts 0.3.0 → 0.4.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/index.d.ts CHANGED
@@ -16,10 +16,42 @@ declare const POST_STATUS: {
16
16
  readonly SCHEDULED: "scheduled";
17
17
  readonly PUBLISHED: "published";
18
18
  readonly ARCHIVED: "archived";
19
+ /** Post da comunidade enviado e aguardando a equipe (moderação `before`). */
20
+ readonly PENDING_REVIEW: "pending_review";
21
+ /** Post da comunidade recusado ou despublicado pela equipe; o autor pode editar e reenviar. */
22
+ readonly REJECTED: "rejected";
19
23
  };
20
24
  type PostStatus = (typeof POST_STATUS)[keyof typeof POST_STATUS];
21
25
  declare const POST_STATUSES: readonly PostStatus[];
22
26
  declare function isPostStatus(value: unknown): value is PostStatus;
27
+ /** Quem escreveu: a equipe (painel) ou um hóspede/cliente (comunidade). */
28
+ declare const POST_ORIGIN: {
29
+ readonly STAFF: "staff";
30
+ readonly COMMUNITY: "community";
31
+ };
32
+ type PostOrigin = (typeof POST_ORIGIN)[keyof typeof POST_ORIGIN];
33
+ declare const POST_ORIGINS: readonly PostOrigin[];
34
+ /** `before`: o post só vai ao ar depois de aprovado. `after`: vai ao ar no envio e a equipe modera depois. */
35
+ declare const COMMUNITY_MODERATION: {
36
+ readonly BEFORE: "before";
37
+ readonly AFTER: "after";
38
+ };
39
+ type CommunityModeration = (typeof COMMUNITY_MODERATION)[keyof typeof COMMUNITY_MODERATION];
40
+ declare const COMMUNITY_MODERATIONS: readonly CommunityModeration[];
41
+ declare const COMMUNITY_REVISION_STATE: {
42
+ readonly PENDING: "pending";
43
+ readonly REJECTED: "rejected";
44
+ };
45
+ type CommunityRevisionState = (typeof COMMUNITY_REVISION_STATE)[keyof typeof COMMUNITY_REVISION_STATE];
46
+ /** Edição de um post da comunidade já publicado: fica à parte até a aprovação e o texto no ar continua o anterior. */
47
+ type CommunityRevision = {
48
+ readonly title: string;
49
+ readonly excerpt: string | null;
50
+ readonly body: string;
51
+ readonly state: CommunityRevisionState;
52
+ /** ISO 8601. */
53
+ readonly submittedAt: string;
54
+ };
23
55
  /** Visão do painel: tudo, inclusive rascunho e campos de operação. */
24
56
  type Post = {
25
57
  readonly id: string;
@@ -48,6 +80,17 @@ type Post = {
48
80
  readonly readingTimeMinutes: number;
49
81
  readonly createdAt: string;
50
82
  readonly updatedAt: string;
83
+ readonly origin: PostOrigin;
84
+ /** Só post da comunidade; `null` na equipe. Identificador opaco da conta do autor no host. */
85
+ readonly authorAccountId: string | null;
86
+ readonly authorDisplayName: string | null;
87
+ /** `YYYY-MM`: mês da estadia/compra que habilitou o autor, no primeiro envio. */
88
+ readonly authorReferenceMonth: string | null;
89
+ readonly reviewNote: string | null;
90
+ readonly termsAcceptedAt: string | null;
91
+ readonly submittedAt: string | null;
92
+ readonly pendingRevision: CommunityRevision | null;
93
+ readonly openReportCount: number;
51
94
  };
52
95
  /** Item de listagem do painel: sem o corpo, que pode ter dezenas de KB por post. */
53
96
  type PostSummary = Omit<Post, 'body'>;
@@ -75,6 +118,12 @@ type PublicPost = {
75
118
  readonly seoDescription: string | null;
76
119
  readonly canonicalUrl: string | null;
77
120
  readonly readingTimeMinutes: number;
121
+ readonly origin: PostOrigin;
122
+ /** Só post da comunidade. Nunca expõe a conta do autor, a nota da equipe nem revisão pendente. */
123
+ readonly communityAuthor: {
124
+ readonly displayName: string;
125
+ readonly referenceMonth: string | null;
126
+ } | null;
78
127
  };
79
128
  type PublicPostSummary = Omit<PublicPost, 'body'>;
80
129
  type TagCount = {
@@ -98,6 +147,53 @@ type PostCounts = {
98
147
  readonly draft: number;
99
148
  readonly archived: number;
100
149
  readonly templates: number;
150
+ /** Post da comunidade esperando moderação, mais as revisões abertas de posts já publicados. */
151
+ readonly pendingReview: number;
152
+ readonly rejected: number;
153
+ };
154
+ /** Visão do próprio autor sobre o seu post da comunidade. Nunca inclui `archived` nem dados de operação. */
155
+ type CommunityPostStatus = 'draft' | 'pending_review' | 'published' | 'rejected';
156
+ type CommunityPost = {
157
+ readonly id: string;
158
+ readonly shortId: string;
159
+ readonly slug: string;
160
+ readonly title: string;
161
+ readonly excerpt: string | null;
162
+ readonly body: string;
163
+ readonly coverImageUrl: string | null;
164
+ readonly status: CommunityPostStatus;
165
+ readonly displayName: string;
166
+ readonly reviewNote: string | null;
167
+ readonly pendingRevision: CommunityRevision | null;
168
+ readonly publishedAt: string | null;
169
+ readonly createdAt: string;
170
+ readonly updatedAt: string;
171
+ };
172
+ type ContentSettings = {
173
+ readonly communityModeration: CommunityModeration;
174
+ /** Posts novos por conta numa janela móvel de 24 h. */
175
+ readonly communityDailyLimit: number;
176
+ /** Fotos por post da comunidade. */
177
+ readonly maxImagesPerPost: number;
178
+ };
179
+ /** Sem linha em `content_settings`, a empresa usa este padrão. */
180
+ declare const DEFAULT_CONTENT_SETTINGS: ContentSettings;
181
+ type BulkModerationResult = {
182
+ readonly succeeded: readonly string[];
183
+ readonly failed: readonly {
184
+ readonly id: string;
185
+ readonly code: string;
186
+ readonly message: string;
187
+ }[];
188
+ };
189
+ /** Denúncia de leitor: sem IP e sem identidade de quem denunciou, de propósito. */
190
+ type PostReport = {
191
+ readonly id: string;
192
+ readonly postId: string;
193
+ readonly reason: string;
194
+ readonly createdAt: string;
195
+ readonly resolvedAt: string | null;
196
+ readonly resolvedBy: string | null;
101
197
  };
102
198
  declare const RECURRENCE_FREQUENCY: {
103
199
  readonly WEEKLY: "weekly";
@@ -130,7 +226,11 @@ declare class ContentError extends Error {
130
226
  readonly statusCode: number;
131
227
  readonly code: string;
132
228
  readonly details?: Record<string, unknown> | undefined;
133
- constructor(message: string, statusCode: number, code: string, details?: Record<string, unknown> | undefined);
229
+ /** Vai na resposta HTTP (`details` não vai): só valores que o cliente pode ver, nunca ids de conta. */
230
+ readonly publicDetails?: Record<string, unknown> | undefined;
231
+ constructor(message: string, statusCode: number, code: string, details?: Record<string, unknown> | undefined,
232
+ /** Vai na resposta HTTP (`details` não vai): só valores que o cliente pode ver, nunca ids de conta. */
233
+ publicDetails?: Record<string, unknown> | undefined);
134
234
  }
135
235
  declare const CONTENT_ERROR_CODES: {
136
236
  readonly POST_NOT_FOUND: "CONTENT_POST_NOT_FOUND";
@@ -144,6 +244,15 @@ declare const CONTENT_ERROR_CODES: {
144
244
  readonly NOT_PUBLISHED: "CONTENT_NOT_PUBLISHED";
145
245
  readonly REPUBLISH_DATE_IN_FUTURE: "CONTENT_REPUBLISH_DATE_IN_FUTURE";
146
246
  readonly RECURRENCE_NOT_FOUND: "CONTENT_RECURRENCE_NOT_FOUND";
247
+ readonly COMMUNITY_UNAUTHENTICATED: "CONTENT_COMMUNITY_UNAUTHENTICATED";
248
+ readonly COMMUNITY_AUTHOR_NOT_ELIGIBLE: "CONTENT_COMMUNITY_AUTHOR_NOT_ELIGIBLE";
249
+ readonly COMMUNITY_DAILY_LIMIT: "CONTENT_COMMUNITY_DAILY_LIMIT";
250
+ readonly COMMUNITY_TERMS_REQUIRED: "CONTENT_COMMUNITY_TERMS_REQUIRED";
251
+ readonly COMMUNITY_TOO_MANY_IMAGES: "CONTENT_COMMUNITY_TOO_MANY_IMAGES";
252
+ readonly COMMUNITY_IMAGE_NOT_ALLOWED: "CONTENT_COMMUNITY_IMAGE_NOT_ALLOWED";
253
+ readonly INVALID_TRANSITION: "CONTENT_INVALID_TRANSITION";
254
+ readonly COMMUNITY_POST_READ_ONLY: "CONTENT_COMMUNITY_POST_READ_ONLY";
255
+ readonly REPORT_NOT_FOUND: "CONTENT_REPORT_NOT_FOUND";
147
256
  };
148
257
  type ContentErrorCode = (typeof CONTENT_ERROR_CODES)[keyof typeof CONTENT_ERROR_CODES];
149
258
  /** 404 também para post de outra empresa: confirmar a existência já seria vazamento. */
@@ -195,6 +304,42 @@ declare class RecurrenceNotFoundError extends ContentError {
195
304
  readonly reference: string;
196
305
  constructor(reference: string);
197
306
  }
307
+ declare class CommunityUnauthenticatedError extends ContentError {
308
+ constructor();
309
+ }
310
+ declare class CommunityAuthorNotEligibleError extends ContentError {
311
+ constructor();
312
+ }
313
+ declare class CommunityDailyLimitError extends ContentError {
314
+ readonly limit: number;
315
+ readonly retryAfterSeconds: number;
316
+ constructor(limit: number, retryAfterSeconds: number);
317
+ }
318
+ declare class CommunityTermsRequiredError extends ContentError {
319
+ constructor();
320
+ }
321
+ declare class CommunityTooManyImagesError extends ContentError {
322
+ readonly max: number;
323
+ constructor(max: number);
324
+ }
325
+ /** Só foto enviada pela própria conta, pelo módulo, entra no corpo: URL externa seria rastreador ou conteúdo sem moderação. */
326
+ declare class CommunityImageNotAllowedError extends ContentError {
327
+ constructor();
328
+ }
329
+ declare class InvalidPostTransitionError extends ContentError {
330
+ readonly from: string;
331
+ readonly action: string;
332
+ constructor(from: string, action: string);
333
+ }
334
+ /** A equipe modera post da comunidade, não o reescreve: editar, agendar ou virar modelo é recusado. */
335
+ declare class CommunityPostReadOnlyError extends ContentError {
336
+ readonly postId: string;
337
+ constructor(postId: string);
338
+ }
339
+ declare class ReportNotFoundError extends ContentError {
340
+ readonly reference: string;
341
+ constructor(reference: string);
342
+ }
198
343
 
199
344
  /**
200
345
  * Copyright (c) 2026 Ada Technology. MIT License.
@@ -215,7 +360,15 @@ declare const POST_LIMITS: {
215
360
  readonly SEARCH: 120;
216
361
  readonly ADMIN_PAGE_SIZE: 100;
217
362
  readonly PUBLIC_PAGE_SIZE: 50;
363
+ readonly DISPLAY_NAME_MIN: 2;
364
+ readonly DISPLAY_NAME_MAX: 40;
365
+ readonly REVIEW_NOTE: 500;
366
+ readonly REPORT_REASON_MIN: 3;
367
+ readonly REPORT_REASON_MAX: 300;
368
+ readonly BULK_IDS: 100;
218
369
  };
370
+ declare const POST_ORIGIN_FILTERS: readonly ["staff", "community", "all"];
371
+ type PostOriginFilter = (typeof POST_ORIGIN_FILTERS)[number];
219
372
  declare const slugSchema: z.ZodEffects<z.ZodString, string, string>;
220
373
  /** Só http(s): `javascript:` numa capa ou no canonical viraria `<a href>` ou `<link>` no site. */
221
374
  declare const httpUrlSchema: z.ZodEffects<z.ZodString, string, string>;
@@ -366,7 +519,9 @@ declare const listPostsQuerySchema: z.ZodObject<{
366
519
  order: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
367
520
  /** `true`: só modelos. Ausente/`false`: só posts (modelo nunca aparece misturado na lista). */
368
521
  isTemplate: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodBoolean, z.ZodEnum<["true", "false"]>]>, boolean, boolean | "true" | "false">>;
522
+ origin: z.ZodDefault<z.ZodEnum<["staff", "community", "all"]>>;
369
523
  }, "strip", z.ZodTypeAny, {
524
+ origin: "staff" | "community" | "all";
370
525
  sort: "title" | "status" | "publishedAt" | "updatedAt";
371
526
  page: number;
372
527
  pageSize: number;
@@ -378,6 +533,7 @@ declare const listPostsQuerySchema: z.ZodObject<{
378
533
  }, {
379
534
  status?: PostStatus | undefined;
380
535
  isTemplate?: boolean | "true" | "false" | undefined;
536
+ origin?: "staff" | "community" | "all" | undefined;
381
537
  sort?: "title" | "status" | "publishedAt" | "updatedAt" | undefined;
382
538
  page?: number | undefined;
383
539
  pageSize?: number | undefined;
@@ -390,11 +546,14 @@ declare const listPublishedPostsQuerySchema: z.ZodObject<{
390
546
  page: z.ZodDefault<z.ZodNumber>;
391
547
  pageSize: z.ZodDefault<z.ZodNumber>;
392
548
  tag: z.ZodOptional<z.ZodString>;
549
+ origin: z.ZodDefault<z.ZodEnum<["staff", "community", "all"]>>;
393
550
  }, "strip", z.ZodTypeAny, {
551
+ origin: "staff" | "community" | "all";
394
552
  page: number;
395
553
  pageSize: number;
396
554
  tag?: string | undefined;
397
555
  }, {
556
+ origin?: "staff" | "community" | "all" | undefined;
398
557
  page?: number | undefined;
399
558
  pageSize?: number | undefined;
400
559
  tag?: string | undefined;
@@ -455,6 +614,141 @@ declare const updateRecurrenceSchema: z.ZodObject<{
455
614
  nextRunAt?: string | undefined;
456
615
  }>;
457
616
  type UpdateRecurrenceInput = z.input<typeof updateRecurrenceSchema>;
617
+ /** Nome exibido no post: sem contato nem link, que expõem o hóspede e viram spam. */
618
+ declare const communityDisplayNameSchema: z.ZodEffects<z.ZodString, string, string>;
619
+ /** Sem capa, slug, tags nem status: a capa é a 1ª imagem do corpo e o resto é decisão da equipe. */
620
+ declare const createCommunityPostSchema: z.ZodObject<{
621
+ title: z.ZodString;
622
+ body: z.ZodString;
623
+ excerpt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
624
+ displayName: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
625
+ }, "strict", z.ZodTypeAny, {
626
+ body: string;
627
+ title: string;
628
+ excerpt?: string | null | undefined;
629
+ displayName?: string | undefined;
630
+ }, {
631
+ body: string;
632
+ title: string;
633
+ excerpt?: string | null | undefined;
634
+ displayName?: string | undefined;
635
+ }>;
636
+ type CreateCommunityPostInput = z.input<typeof createCommunityPostSchema>;
637
+ declare const updateCommunityPostSchema: z.ZodObject<{
638
+ title: z.ZodOptional<z.ZodString>;
639
+ body: z.ZodOptional<z.ZodString>;
640
+ excerpt: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
641
+ displayName: z.ZodOptional<z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>>;
642
+ }, "strict", z.ZodTypeAny, {
643
+ body?: string | undefined;
644
+ title?: string | undefined;
645
+ excerpt?: string | null | undefined;
646
+ displayName?: string | undefined;
647
+ }, {
648
+ body?: string | undefined;
649
+ title?: string | undefined;
650
+ excerpt?: string | null | undefined;
651
+ displayName?: string | undefined;
652
+ }>;
653
+ type UpdateCommunityPostInput = z.input<typeof updateCommunityPostSchema>;
654
+ declare const submitCommunityPostSchema: z.ZodObject<{
655
+ termsAccepted: z.ZodBoolean;
656
+ }, "strict", z.ZodTypeAny, {
657
+ termsAccepted: boolean;
658
+ }, {
659
+ termsAccepted: boolean;
660
+ }>;
661
+ type SubmitCommunityPostInput = z.input<typeof submitCommunityPostSchema>;
662
+ declare const rejectPostSchema: z.ZodObject<{
663
+ note: z.ZodString;
664
+ }, "strict", z.ZodTypeAny, {
665
+ note: string;
666
+ }, {
667
+ note: string;
668
+ }>;
669
+ type RejectPostInput = z.input<typeof rejectPostSchema>;
670
+ declare const unpublishCommunityPostSchema: z.ZodObject<{
671
+ note: z.ZodOptional<z.ZodString>;
672
+ }, "strict", z.ZodTypeAny, {
673
+ note?: string | undefined;
674
+ }, {
675
+ note?: string | undefined;
676
+ }>;
677
+ type UnpublishCommunityPostInput = z.input<typeof unpublishCommunityPostSchema>;
678
+ declare const BULK_MODERATION_ACTIONS: readonly ["approve", "reject", "unpublish", "archive"];
679
+ type BulkModerationAction = (typeof BULK_MODERATION_ACTIONS)[number];
680
+ declare const bulkModerationSchema: z.ZodObject<{
681
+ action: z.ZodEnum<["approve", "reject", "unpublish", "archive"]>;
682
+ ids: z.ZodArray<z.ZodString, "many">;
683
+ note: z.ZodOptional<z.ZodString>;
684
+ }, "strict", z.ZodTypeAny, {
685
+ action: "approve" | "reject" | "unpublish" | "archive";
686
+ ids: string[];
687
+ note?: string | undefined;
688
+ }, {
689
+ action: "approve" | "reject" | "unpublish" | "archive";
690
+ ids: string[];
691
+ note?: string | undefined;
692
+ }>;
693
+ type BulkModerationInput = z.input<typeof bulkModerationSchema>;
694
+ declare const contentSettingsSchema: z.ZodObject<{
695
+ communityModeration: z.ZodEnum<[CommunityModeration, ...CommunityModeration[]]>;
696
+ communityDailyLimit: z.ZodNumber;
697
+ maxImagesPerPost: z.ZodNumber;
698
+ }, "strict", z.ZodTypeAny, {
699
+ communityModeration: CommunityModeration;
700
+ communityDailyLimit: number;
701
+ maxImagesPerPost: number;
702
+ }, {
703
+ communityModeration: CommunityModeration;
704
+ communityDailyLimit: number;
705
+ maxImagesPerPost: number;
706
+ }>;
707
+ type ContentSettingsInput = z.input<typeof contentSettingsSchema>;
708
+ declare const createPostReportSchema: z.ZodObject<{
709
+ reason: z.ZodString;
710
+ }, "strict", z.ZodTypeAny, {
711
+ reason: string;
712
+ }, {
713
+ reason: string;
714
+ }>;
715
+ type CreatePostReportInput = z.input<typeof createPostReportSchema>;
716
+ declare const REPORT_STATUSES: readonly ["open", "resolved"];
717
+ type ReportStatus = (typeof REPORT_STATUSES)[number];
718
+ declare const listPostReportsQuerySchema: z.ZodObject<{
719
+ page: z.ZodDefault<z.ZodNumber>;
720
+ pageSize: z.ZodDefault<z.ZodNumber>;
721
+ status: z.ZodDefault<z.ZodEnum<["open", "resolved"]>>;
722
+ }, "strip", z.ZodTypeAny, {
723
+ status: "open" | "resolved";
724
+ page: number;
725
+ pageSize: number;
726
+ }, {
727
+ status?: "open" | "resolved" | undefined;
728
+ page?: number | undefined;
729
+ pageSize?: number | undefined;
730
+ }>;
731
+ type ListPostReportsQuery = z.output<typeof listPostReportsQuerySchema>;
732
+ /** Lida do jsonb `pending_revision`: valida na leitura porque a coluna não tem forma garantida pelo banco. */
733
+ declare const communityRevisionSchema: z.ZodObject<{
734
+ title: z.ZodString;
735
+ excerpt: z.ZodNullable<z.ZodString>;
736
+ body: z.ZodString;
737
+ state: z.ZodEnum<["pending", "rejected"]>;
738
+ submittedAt: z.ZodString;
739
+ }, "strip", z.ZodTypeAny, {
740
+ body: string;
741
+ title: string;
742
+ excerpt: string | null;
743
+ submittedAt: string;
744
+ state: "rejected" | "pending";
745
+ }, {
746
+ body: string;
747
+ title: string;
748
+ excerpt: string | null;
749
+ submittedAt: string;
750
+ state: "rejected" | "pending";
751
+ }>;
458
752
 
459
753
  /**
460
754
  * Copyright (c) 2026 Ada Technology. MIT License.
@@ -501,13 +795,69 @@ type PostChangedEvent = {
501
795
  readonly type: PostEventType;
502
796
  readonly post: Post;
503
797
  };
798
+ type CommunitySubmissionKind = 'new' | 'revision';
799
+ /** Só ids e enums: nunca nome exibido, título ou corpo (vão para sino, e-mail e log do host). */
800
+ type CommunityPostSubmittedEvent = {
801
+ readonly companyId: string;
802
+ readonly postId: string;
803
+ readonly authorAccountId: string;
804
+ readonly kind: CommunitySubmissionKind;
805
+ readonly moderation: CommunityModeration;
806
+ };
807
+ type CommunityReviewDecision = 'approved' | 'rejected' | 'unpublished' | 'archived';
808
+ type CommunityReviewTarget = 'post' | 'revision';
809
+ type CommunityPostReviewedEvent = {
810
+ readonly companyId: string;
811
+ readonly postId: string;
812
+ readonly authorAccountId: string;
813
+ readonly decision: CommunityReviewDecision;
814
+ readonly target: CommunityReviewTarget;
815
+ readonly actorUserId: string;
816
+ readonly statusBefore: PostStatus;
817
+ readonly statusAfter: PostStatus;
818
+ };
819
+ type PostReportedEvent = {
820
+ readonly companyId: string;
821
+ readonly postId: string;
822
+ readonly reportId: string;
823
+ };
504
824
  type ContentHooks = {
505
825
  /**
506
826
  * Depois de cada escrita. Uso típico: purgar cache de CDN, revalidar a página estática do post,
507
827
  * avisar assinantes. Erro aqui é logado e não desfaz a escrita.
508
828
  */
509
829
  readonly onPostChanged?: (event: PostChangedEvent) => void | Promise<void>;
830
+ /** Envio ou reenvio de post da comunidade. Uso típico: avisar a equipe (sino). */
831
+ readonly onCommunityPostSubmitted?: (event: CommunityPostSubmittedEvent) => void | Promise<void>;
832
+ /** Decisão da equipe. Uso típico: e-mail ao autor e auditoria com origem painel. */
833
+ readonly onCommunityPostReviewed?: (event: CommunityPostReviewedEvent) => void | Promise<void>;
834
+ readonly onPostReported?: (event: PostReportedEvent) => void | Promise<void>;
835
+ };
836
+ /** Quem está logado no host e de que empresa; o módulo nunca vê credencial nem sessão. */
837
+ type CommunityAuthorIdentity = {
838
+ readonly companyId: string;
839
+ readonly accountId: string;
840
+ /** Nome sugerido ao autor; ele pode trocar por outro ao escrever. */
841
+ readonly defaultDisplayName: string;
842
+ };
843
+ /** `referenceMonth` (`YYYY-MM`) é o mês da estadia/compra que habilitou o autor, quando o host sabe. */
844
+ type CommunityEligibility = {
845
+ readonly eligible: false;
846
+ } | {
847
+ readonly eligible: true;
848
+ readonly referenceMonth?: string;
510
849
  };
850
+ /** O handler só recebe cabeçalhos (`RequestContext`): a porta resolve a sessão a partir deles. */
851
+ interface CommunityAuthorPort {
852
+ resolveAuthor(params: {
853
+ readonly headers: Readonly<Record<string, string>>;
854
+ }): Promise<CommunityAuthorIdentity | undefined>;
855
+ /** Chamada em toda requisição de comunidade, não só na criação: elegibilidade pode ser perdida. */
856
+ checkEligibility(params: {
857
+ readonly companyId: string;
858
+ readonly accountId: string;
859
+ }): Promise<CommunityEligibility>;
860
+ }
511
861
  type ContentFeedConfig = {
512
862
  /** Endereço público do site, absoluto (`https://exemplo.com`). */
513
863
  readonly siteUrl: string;
@@ -812,6 +1162,13 @@ declare function sanitizeLinkUrl(url: string): string | undefined;
812
1162
  declare function sanitizeImageUrl(url: string): string | undefined;
813
1163
  declare function isAbsoluteHttpUrl(url: string): boolean;
814
1164
 
1165
+ /**
1166
+ * Copyright (c) 2026 Ada Technology. MIT License.
1167
+ */
1168
+
1169
+ /** Endereço de toda imagem do corpo (inline, figura e galeria), na ordem do texto: base do limite e da lista permitida. */
1170
+ declare function collectImageSources(document: MarkdownDocument): string[];
1171
+
815
1172
  /**
816
1173
  * Copyright (c) 2026 Ada Technology. MIT License.
817
1174
  */
@@ -873,4 +1230,4 @@ declare function buildAtomFeed(params: {
873
1230
  }): string;
874
1231
  declare function buildSitemapXml(entries: readonly SitemapEntry[]): string;
875
1232
 
876
- export { CONTENT_ERROR_CODES, type ClockPort, ConfigMissingError, ContentError, type ContentErrorCode, type ContentFeedConfig, type ContentHooks, type ContentImageStoragePort, type ContentModuleConfig, type CreateFromTemplateInput, type CreatePostInput, type CreateRecurrenceInput, DEFAULT_ADMIN_SCOPES, DEFAULT_LINK_REL, DEFAULT_POST_PATH_TEMPLATE, DEFAULT_PUBLIC_CACHE_CONTROL, DEFAULT_SHORT_SLUG_LENGTH, DEFAULT_WORDS_PER_MINUTE, DuplicateSlugError, type FeedChannel, type FeedItem, ImageStorageDisabledError, InvalidCoverImageError, type InvalidImageReason, InvalidSlugError, type ListPostsQuery, type ListPublishedPostsQuery, type LogMeta, type LoggerPort, type MarkdownBlock, type MarkdownDocument, type MarkdownFigureImage, type MarkdownGalleryImage, type MarkdownInline, type MarkdownRenderOptions, NotATemplateError, POST_EVENT, POST_LIMITS, POST_SORT_FIELDS, POST_STATUS, POST_STATUSES, PT_BR_STOP_WORDS, type Paginated, type Pagination, type ParsedPostRef, type Post, type PostChangedEvent, type PostCounts, type PostEventType, PostNotFoundError, PostNotPublishedError, type PostSortField, type PostStatus, type PostSummary, type PublicPost, type PublicPostSummary, type PublishPostInput, RECURRENCE_FREQUENCIES, RECURRENCE_FREQUENCY, type RecurrenceFrequency, RecurrenceNotFoundError, type RecurrenceRule, RepublishDateInFutureError, type RepublishPostInput, SHORT_ID_LENGTH, SLUG_MAX_LENGTH, type SaveAsTemplateInput, type ShortSlugOptions, type SitemapEntry, TAGS_MAX_COUNT, TAG_MAX_LENGTH, type TagCount, type TagLabels, TemplateNotPublishableError, type UpdatePostInput, type UpdateRecurrenceInput, buildAtomFeed, buildExcerpt, buildPostPath, buildPostRef, buildPostUrl, buildRssFeed, buildShortSlug, buildSitemapXml, buildTagLabels, countWords, createFromTemplateSchema, createHeadingIdGenerator, createPostSchema, createRecurrenceSchema, documentToPlainText, escapeHtml, escapeXml, estimateReadingTimeMinutes, formatTagLabel, httpUrlSchema, inlineToPlainText, isAbsoluteHttpUrl, isCanonicalPostRef, isPostStatus, isShortId, isValidSlug, listPostsQuerySchema, listPublishedPostsQuerySchema, markdownToPlainText, normalizeTag, normalizeTags, parseInline, parseMarkdown, parsePostPath, parsePostRef, postFieldsSchema, publishPostSchema, renderMarkdownDocument, renderMarkdownToHtml, republishPostSchema, resolveHeadingLevel, sanitizeImageUrl, sanitizeLinkUrl, saveAsTemplateSchema, slugSchema, slugify, updatePostSchema, updateRecurrenceSchema, withSlugSuffix };
1233
+ export { BULK_MODERATION_ACTIONS, type BulkModerationAction, type BulkModerationInput, type BulkModerationResult, COMMUNITY_MODERATION, COMMUNITY_MODERATIONS, COMMUNITY_REVISION_STATE, CONTENT_ERROR_CODES, type ClockPort, type CommunityAuthorIdentity, CommunityAuthorNotEligibleError, type CommunityAuthorPort, CommunityDailyLimitError, type CommunityEligibility, CommunityImageNotAllowedError, type CommunityModeration, type CommunityPost, CommunityPostReadOnlyError, type CommunityPostReviewedEvent, type CommunityPostStatus, type CommunityPostSubmittedEvent, type CommunityReviewDecision, type CommunityReviewTarget, type CommunityRevision, type CommunityRevisionState, type CommunitySubmissionKind, CommunityTermsRequiredError, CommunityTooManyImagesError, CommunityUnauthenticatedError, ConfigMissingError, ContentError, type ContentErrorCode, type ContentFeedConfig, type ContentHooks, type ContentImageStoragePort, type ContentModuleConfig, type ContentSettings, type ContentSettingsInput, type CreateCommunityPostInput, type CreateFromTemplateInput, type CreatePostInput, type CreatePostReportInput, type CreateRecurrenceInput, DEFAULT_ADMIN_SCOPES, DEFAULT_CONTENT_SETTINGS, DEFAULT_LINK_REL, DEFAULT_POST_PATH_TEMPLATE, DEFAULT_PUBLIC_CACHE_CONTROL, DEFAULT_SHORT_SLUG_LENGTH, DEFAULT_WORDS_PER_MINUTE, DuplicateSlugError, type FeedChannel, type FeedItem, ImageStorageDisabledError, InvalidCoverImageError, type InvalidImageReason, InvalidPostTransitionError, InvalidSlugError, type ListPostReportsQuery, type ListPostsQuery, type ListPublishedPostsQuery, type LogMeta, type LoggerPort, type MarkdownBlock, type MarkdownDocument, type MarkdownFigureImage, type MarkdownGalleryImage, type MarkdownInline, type MarkdownRenderOptions, NotATemplateError, POST_EVENT, POST_LIMITS, POST_ORIGIN, POST_ORIGINS, POST_ORIGIN_FILTERS, POST_SORT_FIELDS, POST_STATUS, POST_STATUSES, PT_BR_STOP_WORDS, type Paginated, type Pagination, type ParsedPostRef, type Post, type PostChangedEvent, type PostCounts, type PostEventType, PostNotFoundError, PostNotPublishedError, type PostOrigin, type PostOriginFilter, type PostReport, type PostReportedEvent, type PostSortField, type PostStatus, type PostSummary, type PublicPost, type PublicPostSummary, type PublishPostInput, RECURRENCE_FREQUENCIES, RECURRENCE_FREQUENCY, REPORT_STATUSES, type RecurrenceFrequency, RecurrenceNotFoundError, type RecurrenceRule, type RejectPostInput, ReportNotFoundError, type ReportStatus, RepublishDateInFutureError, type RepublishPostInput, SHORT_ID_LENGTH, SLUG_MAX_LENGTH, type SaveAsTemplateInput, type ShortSlugOptions, type SitemapEntry, type SubmitCommunityPostInput, TAGS_MAX_COUNT, TAG_MAX_LENGTH, type TagCount, type TagLabels, TemplateNotPublishableError, type UnpublishCommunityPostInput, type UpdateCommunityPostInput, type UpdatePostInput, type UpdateRecurrenceInput, buildAtomFeed, buildExcerpt, buildPostPath, buildPostRef, buildPostUrl, buildRssFeed, buildShortSlug, buildSitemapXml, buildTagLabels, bulkModerationSchema, collectImageSources, communityDisplayNameSchema, communityRevisionSchema, contentSettingsSchema, countWords, createCommunityPostSchema, createFromTemplateSchema, createHeadingIdGenerator, createPostReportSchema, createPostSchema, createRecurrenceSchema, documentToPlainText, escapeHtml, escapeXml, estimateReadingTimeMinutes, formatTagLabel, httpUrlSchema, inlineToPlainText, isAbsoluteHttpUrl, isCanonicalPostRef, isPostStatus, isShortId, isValidSlug, listPostReportsQuerySchema, listPostsQuerySchema, listPublishedPostsQuerySchema, markdownToPlainText, normalizeTag, normalizeTags, parseInline, parseMarkdown, parsePostPath, parsePostRef, postFieldsSchema, publishPostSchema, rejectPostSchema, renderMarkdownDocument, renderMarkdownToHtml, republishPostSchema, resolveHeadingLevel, sanitizeImageUrl, sanitizeLinkUrl, saveAsTemplateSchema, slugSchema, slugify, submitCommunityPostSchema, unpublishCommunityPostSchema, updateCommunityPostSchema, updatePostSchema, updateRecurrenceSchema, withSlugSuffix };