@openpeepshq/common 0.7.0 → 0.9.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.
@@ -0,0 +1,25 @@
1
+ export declare const visibleTextLength: (markdown?: string | null) => number;
2
+ /** Visible-text budget for note/question content. */
3
+ export declare const POST_MAX_VISIBLE_LENGTH = 500;
4
+ /** Raw markdown backstop for note/question content. */
5
+ export declare const POST_MAX_RAW_LENGTH = 5000;
6
+ /**
7
+ * Whitespace-only content is measured as empty (nothing renders), so the
8
+ * same "is there anything to send" test must ignore whitespace everywhere
9
+ * a composer or schema checks it.
10
+ */
11
+ export declare const hasVisibleText: (content?: string | null) => boolean;
12
+ /** True when note/question content fits the visible + raw budgets. */
13
+ export declare const postContentWithinBudget: (content?: string | null) => boolean;
14
+ /**
15
+ * Shared composer submit gate over the visible budget. Question composers
16
+ * need visible text for their poll to make sense; note composers accept an
17
+ * attachment instead. In-flight state (submitting, pending uploads,
18
+ * audience/group requirements) stays at the call site.
19
+ */
20
+ export declare const canSubmitPostContent: ({ visibleContentLength, attachmentsLength, composerType, pollOptionsValid, }: {
21
+ visibleContentLength: number;
22
+ attachmentsLength: number;
23
+ composerType?: "note" | "question";
24
+ pollOptionsValid?: boolean;
25
+ }) => boolean;
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Visible-text measurement for the post content budget.
3
+ *
4
+ * Counts what a reader sees, not the raw markdown source:
5
+ * - fenced code counts its content verbatim (it renders as visible code)
6
+ * - links and images count their text/alt, not the URL
7
+ * - structural line syntax (table cells/pipes, list markers, setext
8
+ * underlines, thematic breaks, headings, blockquotes) and HTML tags
9
+ * render no characters and do not count
10
+ * - whitespace runs collapse and line edges trim, so the count tracks
11
+ * what renders
12
+ *
13
+ * This is a budget estimate, not a markdown parser: unbounded content is
14
+ * guarded by the raw-length cap (`POST_MAX_RAW_LENGTH`), not by this
15
+ * function.
16
+ */
17
+ const FENCE_RE = /^[ \t]*```[^\n]*\n?([\s\S]*?)^[ \t]*```[ \t]*$/gm;
18
+ // Built from a string, not a regex literal: ESLint's no-control-regex
19
+ // rejects control characters in regex sources. U+FFFE is a noncharacter
20
+ // no renderer emits, and stray occurrences are stripped from the content
21
+ // before fencing, so it cannot collide with real input.
22
+ const FENCE_SENTINEL_RE = () => new RegExp('\\uFFFE(\\d+)\\uFFFE', 'g');
23
+ /**
24
+ * A line that renders nothing: table delimiter rows (`| --- | --- |`),
25
+ * setext underlines (`---`, `===`), and thematic breaks (`---`, `***`,
26
+ * `___`). The character class mirrors their allowed symbols; `-` is last
27
+ * so it cannot form a range.
28
+ */
29
+ const INVISIBLE_LINE_RE = /^[ \t]*\|?[ \t]*[-=*_][ \t:|=*_-]*\|?[ \t]*$/;
30
+ export const visibleTextLength = (markdown) => {
31
+ if (!markdown)
32
+ return 0;
33
+ // Stray sentinels in user content must not collide with the fence
34
+ // sentinel (U+FFFE is a noncharacter no renderer emits).
35
+ let text = markdown
36
+ .replace(/\r\n?/g, '\n')
37
+ .replaceAll('\uFFFE', '')
38
+ .replaceAll('\u0000', '');
39
+ // Fenced code renders verbatim, so hold its content aside while the
40
+ // line-structural passes run on the surrounding text.
41
+ const fenced = [];
42
+ text = text.replace(FENCE_RE, (_match, content) => {
43
+ fenced.push(content);
44
+ return `\uFFFE${fenced.length - 1}\uFFFE`;
45
+ });
46
+ // Inline code counts its content, not the backticks.
47
+ text = text.replace(/`([^`]+)`/g, '$1');
48
+ // Autolinks: the URL is the visible text.
49
+ text = text.replace(/<(https?:\/\/[^>\s]+|mailto:[^>\s]+)>/gi, '$1');
50
+ // Images: count the alt text, drop the marker and URL.
51
+ text = text.replace(/!\[([^\]]*)\]\(((?:[^()]+|\([^()]*\))*)\)/g, '$1');
52
+ // Links: count the text, drop the URL (one level of nested parens ok).
53
+ text = text.replace(/\[([^\]]+)\]\(((?:[^()]+|\([^()]*\))*)\)/g, '$1');
54
+ // Reference-style links: count the text, drop the reference.
55
+ text = text.replace(/\[([^\]]+)\]\[[^\]]*\]/g, '$1');
56
+ // HTML tags: drop the tags, keep the inner text.
57
+ text = text.replace(/<\/?[a-zA-Z][^>]*>/g, '');
58
+ text = text
59
+ .split('\n')
60
+ .map((line) => {
61
+ if (INVISIBLE_LINE_RE.test(line))
62
+ return '';
63
+ return (line
64
+ // Heading and blockquote markers.
65
+ .replace(/^[ \t]*(?:#{1,6}|>)[ \t]*/, '')
66
+ // List markers ("-", "*", "+", "1.", "1)").
67
+ .replace(/^[ \t]*(?:[-*+]|\d{1,9}[.)])[ \t]+/, '')
68
+ // Table cells: the pipes and their padding are syntax.
69
+ .replace(/^[ \t]*\|/, '')
70
+ .replace(/\|[ \t]*$/, '')
71
+ .replace(/\|/g, ' ')
72
+ .replace(/^[ \t]+|[\t ]+$/g, ''));
73
+ })
74
+ .filter((line) => line.length > 0)
75
+ .join('\n');
76
+ // Emphasis/strikethrough markers. `_` inside a word (snake_case) is kept.
77
+ text = text.replace(/[*~]{1,3}/g, '');
78
+ text = text.replace(/(^|\s)_{1,3}(\S)/gm, '$1$2');
79
+ text = text.replace(/(\S)_{1,3}(\s|$)/gm, '$1$2');
80
+ // Whitespace runs collapse to single spaces (the renderer collapses
81
+ // them), so the count tracks what renders.
82
+ text = text.replace(/[\t ]{2,}/g, ' ');
83
+ // Restore the fenced code content verbatim.
84
+ text = text.replace(FENCE_SENTINEL_RE(), (_match, index) => {
85
+ return fenced[Number(index)] ?? '';
86
+ });
87
+ // Count code points so emoji and other astral characters cost what they
88
+ // render, not their UTF-16 surrogate pair.
89
+ return [...text].length;
90
+ };
91
+ /** Visible-text budget for note/question content. */
92
+ export const POST_MAX_VISIBLE_LENGTH = 500;
93
+ /** Raw markdown backstop for note/question content. */
94
+ export const POST_MAX_RAW_LENGTH = 5000;
95
+ /**
96
+ * Whitespace-only content is measured as empty (nothing renders), so the
97
+ * same "is there anything to send" test must ignore whitespace everywhere
98
+ * a composer or schema checks it.
99
+ */
100
+ export const hasVisibleText = (content) => visibleTextLength(content) > 0;
101
+ /** True when note/question content fits the visible + raw budgets. */
102
+ export const postContentWithinBudget = (content) => {
103
+ const raw = content ?? '';
104
+ return (visibleTextLength(raw) <= POST_MAX_VISIBLE_LENGTH &&
105
+ raw.length <= POST_MAX_RAW_LENGTH);
106
+ };
107
+ /**
108
+ * Shared composer submit gate over the visible budget. Question composers
109
+ * need visible text for their poll to make sense; note composers accept an
110
+ * attachment instead. In-flight state (submitting, pending uploads,
111
+ * audience/group requirements) stays at the call site.
112
+ */
113
+ export const canSubmitPostContent = ({ visibleContentLength, attachmentsLength, composerType, pollOptionsValid = true, }) => composerType === 'question'
114
+ ? visibleContentLength > 0 &&
115
+ visibleContentLength <= POST_MAX_VISIBLE_LENGTH &&
116
+ pollOptionsValid
117
+ : visibleContentLength <= POST_MAX_VISIBLE_LENGTH &&
118
+ (visibleContentLength > 0 || attachmentsLength > 0);
@@ -11,6 +11,7 @@ export * from './groupHelpers';
11
11
  export * from './groupTemplateHelpers';
12
12
  export * from './colors';
13
13
  export * from './markdownHelpers';
14
+ export * from './contentLength';
14
15
  export * from './attachmentHelpers';
15
16
  export * from './resources';
16
17
  export * from './eventIcs';
package/dist/lib/index.js CHANGED
@@ -11,6 +11,7 @@ export * from './groupHelpers.js';
11
11
  export * from './groupTemplateHelpers.js';
12
12
  export * from './colors.js';
13
13
  export * from './markdownHelpers.js';
14
+ export * from './contentLength.js';
14
15
  export * from './attachmentHelpers.js';
15
16
  export * from './resources.js';
16
17
  export * from './eventIcs.js';
@@ -104,9 +104,9 @@ export declare const analyticsMemberRowSchema: z.ZodObject<{
104
104
  }, z.core.$strip>;
105
105
  export type AnalyticsMemberRow = z.infer<typeof analyticsMemberRowSchema>;
106
106
  export declare const analyticsPostTypeKeySchema: z.ZodEnum<{
107
+ note: "note";
107
108
  jam: "jam";
108
109
  resource: "resource";
109
- note: "note";
110
110
  event: "event";
111
111
  article: "article";
112
112
  poll: "poll";
@@ -114,9 +114,9 @@ export declare const analyticsPostTypeKeySchema: z.ZodEnum<{
114
114
  export type AnalyticsPostTypeKey = z.infer<typeof analyticsPostTypeKeySchema>;
115
115
  export declare const analyticsPostTypeCountSchema: z.ZodObject<{
116
116
  type: z.ZodEnum<{
117
+ note: "note";
117
118
  jam: "jam";
118
119
  resource: "resource";
119
- note: "note";
120
120
  event: "event";
121
121
  article: "article";
122
122
  poll: "poll";
@@ -271,9 +271,9 @@ export declare const analyticsOverviewSchema: z.ZodObject<{
271
271
  }, z.core.$strip>>;
272
272
  postTypes: z.ZodArray<z.ZodObject<{
273
273
  type: z.ZodEnum<{
274
+ note: "note";
274
275
  jam: "jam";
275
276
  resource: "resource";
276
- note: "note";
277
277
  event: "event";
278
278
  article: "article";
279
279
  poll: "poll";
@@ -1882,9 +1882,9 @@ export type RepostWithPublicProfile = z.infer<typeof repostWithPublicProfileSche
1882
1882
  export declare const publicReplyPostSchema: z.ZodObject<{
1883
1883
  id: z.ZodString;
1884
1884
  type: z.ZodEnum<{
1885
- resource: "resource";
1886
1885
  note: "note";
1887
1886
  question: "question";
1887
+ resource: "resource";
1888
1888
  event: "event";
1889
1889
  article: "article";
1890
1890
  }>;
@@ -3573,9 +3573,9 @@ export declare const publicReplyPostSchema: z.ZodObject<{
3573
3573
  replyTo: z.ZodNullable<z.ZodOptional<z.ZodObject<{
3574
3574
  id: z.ZodString;
3575
3575
  type: z.ZodEnum<{
3576
- resource: "resource";
3577
3576
  note: "note";
3578
3577
  question: "question";
3578
+ resource: "resource";
3579
3579
  event: "event";
3580
3580
  article: "article";
3581
3581
  }>;
@@ -5396,9 +5396,9 @@ export type PublicRsvp = z.infer<typeof publicRsvpSchema>;
5396
5396
  export declare const publicPostSchema: z.ZodObject<{
5397
5397
  id: z.ZodString;
5398
5398
  type: z.ZodEnum<{
5399
- resource: "resource";
5400
5399
  note: "note";
5401
5400
  question: "question";
5401
+ resource: "resource";
5402
5402
  event: "event";
5403
5403
  article: "article";
5404
5404
  }>;
@@ -7315,9 +7315,9 @@ export declare const publicPostSchema: z.ZodObject<{
7315
7315
  latestReplies: z.ZodOptional<z.ZodArray<z.ZodObject<{
7316
7316
  id: z.ZodString;
7317
7317
  type: z.ZodEnum<{
7318
- resource: "resource";
7319
7318
  note: "note";
7320
7319
  question: "question";
7320
+ resource: "resource";
7321
7321
  event: "event";
7322
7322
  article: "article";
7323
7323
  }>;
@@ -9006,9 +9006,9 @@ export declare const publicPostSchema: z.ZodObject<{
9006
9006
  replyTo: z.ZodNullable<z.ZodOptional<z.ZodObject<{
9007
9007
  id: z.ZodString;
9008
9008
  type: z.ZodEnum<{
9009
- resource: "resource";
9010
9009
  note: "note";
9011
9010
  question: "question";
9011
+ resource: "resource";
9012
9012
  event: "event";
9013
9013
  article: "article";
9014
9014
  }>;
@@ -10963,9 +10963,9 @@ export declare const publicPostSchema: z.ZodObject<{
10963
10963
  replyTo: z.ZodNullable<z.ZodOptional<z.ZodObject<{
10964
10964
  id: z.ZodString;
10965
10965
  type: z.ZodEnum<{
10966
- resource: "resource";
10967
10966
  note: "note";
10968
10967
  question: "question";
10968
+ resource: "resource";
10969
10969
  event: "event";
10970
10970
  article: "article";
10971
10971
  }>;
@@ -12654,9 +12654,9 @@ export declare const publicPostSchema: z.ZodObject<{
12654
12654
  replyTo: z.ZodNullable<z.ZodOptional<z.ZodObject<{
12655
12655
  id: z.ZodString;
12656
12656
  type: z.ZodEnum<{
12657
- resource: "resource";
12658
12657
  note: "note";
12659
12658
  question: "question";
12659
+ resource: "resource";
12660
12660
  event: "event";
12661
12661
  article: "article";
12662
12662
  }>;
@@ -14347,9 +14347,9 @@ export declare const publicPostSchema: z.ZodObject<{
14347
14347
  repost: z.ZodNullable<z.ZodOptional<z.ZodObject<{
14348
14348
  id: z.ZodString;
14349
14349
  type: z.ZodEnum<{
14350
- resource: "resource";
14351
14350
  note: "note";
14352
14351
  question: "question";
14352
+ resource: "resource";
14353
14353
  event: "event";
14354
14354
  article: "article";
14355
14355
  }>;
@@ -16037,9 +16037,9 @@ export declare const publicPostSchema: z.ZodObject<{
16037
16037
  replyTo: z.ZodNullable<z.ZodOptional<z.ZodObject<{
16038
16038
  id: z.ZodString;
16039
16039
  type: z.ZodEnum<{
16040
- resource: "resource";
16041
16040
  note: "note";
16042
16041
  question: "question";
16042
+ resource: "resource";
16043
16043
  event: "event";
16044
16044
  article: "article";
16045
16045
  }>;
@@ -17959,9 +17959,9 @@ export declare const publicPostSchema: z.ZodObject<{
17959
17959
  latestReplies: z.ZodOptional<z.ZodArray<z.ZodObject<{
17960
17960
  id: z.ZodString;
17961
17961
  type: z.ZodEnum<{
17962
- resource: "resource";
17963
17962
  note: "note";
17964
17963
  question: "question";
17964
+ resource: "resource";
17965
17965
  event: "event";
17966
17966
  article: "article";
17967
17967
  }>;
@@ -19650,9 +19650,9 @@ export declare const publicPostSchema: z.ZodObject<{
19650
19650
  replyTo: z.ZodNullable<z.ZodOptional<z.ZodObject<{
19651
19651
  id: z.ZodString;
19652
19652
  type: z.ZodEnum<{
19653
- resource: "resource";
19654
19653
  note: "note";
19655
19654
  question: "question";
19655
+ resource: "resource";
19656
19656
  event: "event";
19657
19657
  article: "article";
19658
19658
  }>;
@@ -21871,9 +21871,9 @@ export declare const publicNotificationSchema: z.ZodObject<{
21871
21871
  post: z.ZodOptional<z.ZodNullable<z.ZodObject<{
21872
21872
  id: z.ZodString;
21873
21873
  type: z.ZodEnum<{
21874
- resource: "resource";
21875
21874
  note: "note";
21876
21875
  question: "question";
21876
+ resource: "resource";
21877
21877
  event: "event";
21878
21878
  article: "article";
21879
21879
  }>;
@@ -23790,9 +23790,9 @@ export declare const publicNotificationSchema: z.ZodObject<{
23790
23790
  latestReplies: z.ZodOptional<z.ZodArray<z.ZodObject<{
23791
23791
  id: z.ZodString;
23792
23792
  type: z.ZodEnum<{
23793
- resource: "resource";
23794
23793
  note: "note";
23795
23794
  question: "question";
23795
+ resource: "resource";
23796
23796
  event: "event";
23797
23797
  article: "article";
23798
23798
  }>;
@@ -25481,9 +25481,9 @@ export declare const publicNotificationSchema: z.ZodObject<{
25481
25481
  replyTo: z.ZodNullable<z.ZodOptional<z.ZodObject<{
25482
25482
  id: z.ZodString;
25483
25483
  type: z.ZodEnum<{
25484
- resource: "resource";
25485
25484
  note: "note";
25486
25485
  question: "question";
25486
+ resource: "resource";
25487
25487
  event: "event";
25488
25488
  article: "article";
25489
25489
  }>;
@@ -27438,9 +27438,9 @@ export declare const publicNotificationSchema: z.ZodObject<{
27438
27438
  replyTo: z.ZodNullable<z.ZodOptional<z.ZodObject<{
27439
27439
  id: z.ZodString;
27440
27440
  type: z.ZodEnum<{
27441
- resource: "resource";
27442
27441
  note: "note";
27443
27442
  question: "question";
27443
+ resource: "resource";
27444
27444
  event: "event";
27445
27445
  article: "article";
27446
27446
  }>;
@@ -29129,9 +29129,9 @@ export declare const publicNotificationSchema: z.ZodObject<{
29129
29129
  replyTo: z.ZodNullable<z.ZodOptional<z.ZodObject<{
29130
29130
  id: z.ZodString;
29131
29131
  type: z.ZodEnum<{
29132
- resource: "resource";
29133
29132
  note: "note";
29134
29133
  question: "question";
29134
+ resource: "resource";
29135
29135
  event: "event";
29136
29136
  article: "article";
29137
29137
  }>;
@@ -30822,9 +30822,9 @@ export declare const publicNotificationSchema: z.ZodObject<{
30822
30822
  repost: z.ZodNullable<z.ZodOptional<z.ZodObject<{
30823
30823
  id: z.ZodString;
30824
30824
  type: z.ZodEnum<{
30825
- resource: "resource";
30826
30825
  note: "note";
30827
30826
  question: "question";
30827
+ resource: "resource";
30828
30828
  event: "event";
30829
30829
  article: "article";
30830
30830
  }>;
@@ -32512,9 +32512,9 @@ export declare const publicNotificationSchema: z.ZodObject<{
32512
32512
  replyTo: z.ZodNullable<z.ZodOptional<z.ZodObject<{
32513
32513
  id: z.ZodString;
32514
32514
  type: z.ZodEnum<{
32515
- resource: "resource";
32516
32515
  note: "note";
32517
32516
  question: "question";
32517
+ resource: "resource";
32518
32518
  event: "event";
32519
32519
  article: "article";
32520
32520
  }>;
@@ -34434,9 +34434,9 @@ export declare const publicNotificationSchema: z.ZodObject<{
34434
34434
  latestReplies: z.ZodOptional<z.ZodArray<z.ZodObject<{
34435
34435
  id: z.ZodString;
34436
34436
  type: z.ZodEnum<{
34437
- resource: "resource";
34438
34437
  note: "note";
34439
34438
  question: "question";
34439
+ resource: "resource";
34440
34440
  event: "event";
34441
34441
  article: "article";
34442
34442
  }>;
@@ -36125,9 +36125,9 @@ export declare const publicNotificationSchema: z.ZodObject<{
36125
36125
  replyTo: z.ZodNullable<z.ZodOptional<z.ZodObject<{
36126
36126
  id: z.ZodString;
36127
36127
  type: z.ZodEnum<{
36128
- resource: "resource";
36129
36128
  note: "note";
36130
36129
  question: "question";
36130
+ resource: "resource";
36131
36131
  event: "event";
36132
36132
  article: "article";
36133
36133
  }>;
@@ -39121,6 +39121,7 @@ export type ReportCreationData = z.infer<typeof reportCreationDataSchema>;
39121
39121
  export declare const jamStateSchema: z.ZodObject<{
39122
39122
  active: z.ZodBoolean;
39123
39123
  participants: z.ZodArray<z.ZodUUID>;
39124
+ observers: z.ZodOptional<z.ZodNumber>;
39124
39125
  }, z.core.$strip>;
39125
39126
  export type JamState = z.infer<typeof jamStateSchema>;
39126
39127
  export declare const publicReportSchema: z.ZodObject<{
@@ -39367,9 +39368,9 @@ export declare const publicReportSchema: z.ZodObject<{
39367
39368
  reportedPosts: z.ZodArray<z.ZodObject<{
39368
39369
  id: z.ZodString;
39369
39370
  type: z.ZodEnum<{
39370
- resource: "resource";
39371
39371
  note: "note";
39372
39372
  question: "question";
39373
+ resource: "resource";
39373
39374
  event: "event";
39374
39375
  article: "article";
39375
39376
  }>;
@@ -41286,9 +41287,9 @@ export declare const publicReportSchema: z.ZodObject<{
41286
41287
  latestReplies: z.ZodOptional<z.ZodArray<z.ZodObject<{
41287
41288
  id: z.ZodString;
41288
41289
  type: z.ZodEnum<{
41289
- resource: "resource";
41290
41290
  note: "note";
41291
41291
  question: "question";
41292
+ resource: "resource";
41292
41293
  event: "event";
41293
41294
  article: "article";
41294
41295
  }>;
@@ -42977,9 +42978,9 @@ export declare const publicReportSchema: z.ZodObject<{
42977
42978
  replyTo: z.ZodNullable<z.ZodOptional<z.ZodObject<{
42978
42979
  id: z.ZodString;
42979
42980
  type: z.ZodEnum<{
42980
- resource: "resource";
42981
42981
  note: "note";
42982
42982
  question: "question";
42983
+ resource: "resource";
42983
42984
  event: "event";
42984
42985
  article: "article";
42985
42986
  }>;
@@ -44934,9 +44935,9 @@ export declare const publicReportSchema: z.ZodObject<{
44934
44935
  replyTo: z.ZodNullable<z.ZodOptional<z.ZodObject<{
44935
44936
  id: z.ZodString;
44936
44937
  type: z.ZodEnum<{
44937
- resource: "resource";
44938
44938
  note: "note";
44939
44939
  question: "question";
44940
+ resource: "resource";
44940
44941
  event: "event";
44941
44942
  article: "article";
44942
44943
  }>;
@@ -46625,9 +46626,9 @@ export declare const publicReportSchema: z.ZodObject<{
46625
46626
  replyTo: z.ZodNullable<z.ZodOptional<z.ZodObject<{
46626
46627
  id: z.ZodString;
46627
46628
  type: z.ZodEnum<{
46628
- resource: "resource";
46629
46629
  note: "note";
46630
46630
  question: "question";
46631
+ resource: "resource";
46631
46632
  event: "event";
46632
46633
  article: "article";
46633
46634
  }>;
@@ -48318,9 +48319,9 @@ export declare const publicReportSchema: z.ZodObject<{
48318
48319
  repost: z.ZodNullable<z.ZodOptional<z.ZodObject<{
48319
48320
  id: z.ZodString;
48320
48321
  type: z.ZodEnum<{
48321
- resource: "resource";
48322
48322
  note: "note";
48323
48323
  question: "question";
48324
+ resource: "resource";
48324
48325
  event: "event";
48325
48326
  article: "article";
48326
48327
  }>;
@@ -50008,9 +50009,9 @@ export declare const publicReportSchema: z.ZodObject<{
50008
50009
  replyTo: z.ZodNullable<z.ZodOptional<z.ZodObject<{
50009
50010
  id: z.ZodString;
50010
50011
  type: z.ZodEnum<{
50011
- resource: "resource";
50012
50012
  note: "note";
50013
50013
  question: "question";
50014
+ resource: "resource";
50014
50015
  event: "event";
50015
50016
  article: "article";
50016
50017
  }>;
@@ -51930,9 +51931,9 @@ export declare const publicReportSchema: z.ZodObject<{
51930
51931
  latestReplies: z.ZodOptional<z.ZodArray<z.ZodObject<{
51931
51932
  id: z.ZodString;
51932
51933
  type: z.ZodEnum<{
51933
- resource: "resource";
51934
51934
  note: "note";
51935
51935
  question: "question";
51936
+ resource: "resource";
51936
51937
  event: "event";
51937
51938
  article: "article";
51938
51939
  }>;
@@ -53621,9 +53622,9 @@ export declare const publicReportSchema: z.ZodObject<{
53621
53622
  replyTo: z.ZodNullable<z.ZodOptional<z.ZodObject<{
53622
53623
  id: z.ZodString;
53623
53624
  type: z.ZodEnum<{
53624
- resource: "resource";
53625
53625
  note: "note";
53626
53626
  question: "question";
53627
+ resource: "resource";
53627
53628
  event: "event";
53628
53629
  article: "article";
53629
53630
  }>;
@@ -55598,6 +55599,18 @@ export declare const offsetInfiniteQueryParamsSchema: z.ZodObject<{
55598
55599
  limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
55599
55600
  }, z.core.$strip>;
55600
55601
  export type OffsetInfiniteQueryParams = z.infer<typeof offsetInfiniteQueryParamsSchema> | undefined;
55602
+ /** Span cap of the date-range event feeds (events calendar). */
55603
+ export declare const EVENT_RANGE_MAX_SPAN_MS: number;
55604
+ /** Default page size of the date-range event feeds (events calendar). */
55605
+ export declare const EVENT_RANGE_DEFAULT_LIMIT = 500;
55606
+ /** Query params of the date-range event feeds (events calendar). */
55607
+ export declare const eventRangeQueryParamsSchema: z.ZodObject<{
55608
+ from: z.ZodString;
55609
+ to: z.ZodString;
55610
+ offset: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
55611
+ limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
55612
+ }, z.core.$strip>;
55613
+ export type EventRangeQueryParams = z.infer<typeof eventRangeQueryParamsSchema>;
55601
55614
  export declare const searchResultItemSchema: (baseSchema: z.ZodType) => z.ZodObject<{
55602
55615
  score: z.ZodNumber;
55603
55616
  data: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
@@ -55624,9 +55637,9 @@ export declare const directMessageSearchHitSchema: z.ZodObject<{
55624
55637
  message: z.ZodObject<{
55625
55638
  id: z.ZodString;
55626
55639
  type: z.ZodEnum<{
55627
- resource: "resource";
55628
55640
  note: "note";
55629
55641
  question: "question";
55642
+ resource: "resource";
55630
55643
  event: "event";
55631
55644
  article: "article";
55632
55645
  }>;
@@ -57543,9 +57556,9 @@ export declare const directMessageSearchHitSchema: z.ZodObject<{
57543
57556
  latestReplies: z.ZodOptional<z.ZodArray<z.ZodObject<{
57544
57557
  id: z.ZodString;
57545
57558
  type: z.ZodEnum<{
57546
- resource: "resource";
57547
57559
  note: "note";
57548
57560
  question: "question";
57561
+ resource: "resource";
57549
57562
  event: "event";
57550
57563
  article: "article";
57551
57564
  }>;
@@ -59234,9 +59247,9 @@ export declare const directMessageSearchHitSchema: z.ZodObject<{
59234
59247
  replyTo: z.ZodNullable<z.ZodOptional<z.ZodObject<{
59235
59248
  id: z.ZodString;
59236
59249
  type: z.ZodEnum<{
59237
- resource: "resource";
59238
59250
  note: "note";
59239
59251
  question: "question";
59252
+ resource: "resource";
59240
59253
  event: "event";
59241
59254
  article: "article";
59242
59255
  }>;
@@ -61191,9 +61204,9 @@ export declare const directMessageSearchHitSchema: z.ZodObject<{
61191
61204
  replyTo: z.ZodNullable<z.ZodOptional<z.ZodObject<{
61192
61205
  id: z.ZodString;
61193
61206
  type: z.ZodEnum<{
61194
- resource: "resource";
61195
61207
  note: "note";
61196
61208
  question: "question";
61209
+ resource: "resource";
61197
61210
  event: "event";
61198
61211
  article: "article";
61199
61212
  }>;
@@ -62882,9 +62895,9 @@ export declare const directMessageSearchHitSchema: z.ZodObject<{
62882
62895
  replyTo: z.ZodNullable<z.ZodOptional<z.ZodObject<{
62883
62896
  id: z.ZodString;
62884
62897
  type: z.ZodEnum<{
62885
- resource: "resource";
62886
62898
  note: "note";
62887
62899
  question: "question";
62900
+ resource: "resource";
62888
62901
  event: "event";
62889
62902
  article: "article";
62890
62903
  }>;
@@ -64575,9 +64588,9 @@ export declare const directMessageSearchHitSchema: z.ZodObject<{
64575
64588
  repost: z.ZodNullable<z.ZodOptional<z.ZodObject<{
64576
64589
  id: z.ZodString;
64577
64590
  type: z.ZodEnum<{
64578
- resource: "resource";
64579
64591
  note: "note";
64580
64592
  question: "question";
64593
+ resource: "resource";
64581
64594
  event: "event";
64582
64595
  article: "article";
64583
64596
  }>;
@@ -66265,9 +66278,9 @@ export declare const directMessageSearchHitSchema: z.ZodObject<{
66265
66278
  replyTo: z.ZodNullable<z.ZodOptional<z.ZodObject<{
66266
66279
  id: z.ZodString;
66267
66280
  type: z.ZodEnum<{
66268
- resource: "resource";
66269
66281
  note: "note";
66270
66282
  question: "question";
66283
+ resource: "resource";
66271
66284
  event: "event";
66272
66285
  article: "article";
66273
66286
  }>;
@@ -68187,9 +68200,9 @@ export declare const directMessageSearchHitSchema: z.ZodObject<{
68187
68200
  latestReplies: z.ZodOptional<z.ZodArray<z.ZodObject<{
68188
68201
  id: z.ZodString;
68189
68202
  type: z.ZodEnum<{
68190
- resource: "resource";
68191
68203
  note: "note";
68192
68204
  question: "question";
68205
+ resource: "resource";
68193
68206
  event: "event";
68194
68207
  article: "article";
68195
68208
  }>;
@@ -69878,9 +69891,9 @@ export declare const directMessageSearchHitSchema: z.ZodObject<{
69878
69891
  replyTo: z.ZodNullable<z.ZodOptional<z.ZodObject<{
69879
69892
  id: z.ZodString;
69880
69893
  type: z.ZodEnum<{
69881
- resource: "resource";
69882
69894
  note: "note";
69883
69895
  question: "question";
69896
+ resource: "resource";
69884
69897
  event: "event";
69885
69898
  article: "article";
69886
69899
  }>;
@@ -71846,9 +71859,9 @@ export declare const postCreationDataSchema: z.ZodObject<{
71846
71859
  direct: "direct";
71847
71860
  }>;
71848
71861
  type: z.ZodEnum<{
71849
- resource: "resource";
71850
71862
  note: "note";
71851
71863
  question: "question";
71864
+ resource: "resource";
71852
71865
  event: "event";
71853
71866
  article: "article";
71854
71867
  }>;
@@ -72374,9 +72387,9 @@ export declare const postCreationDataFormSchema: z.ZodObject<{
72374
72387
  direct: "direct";
72375
72388
  }>;
72376
72389
  type: z.ZodEnum<{
72377
- resource: "resource";
72378
72390
  note: "note";
72379
72391
  question: "question";
72392
+ resource: "resource";
72380
72393
  event: "event";
72381
72394
  article: "article";
72382
72395
  }>;