@openpeepshq/common 0.1.44 → 0.1.45

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.
Files changed (47) hide show
  1. package/dist/lib/adminSections.d.ts +4 -0
  2. package/dist/lib/adminSections.js +5 -0
  3. package/dist/lib/capabilitiesHelpers.d.ts +7 -7
  4. package/dist/lib/capabilitiesHelpers.js +4 -11
  5. package/dist/lib/eventIcs.js +56 -2
  6. package/dist/lib/eventRecurrence.d.ts +30 -0
  7. package/dist/lib/eventRecurrence.js +279 -0
  8. package/dist/lib/eventTime.d.ts +22 -0
  9. package/dist/lib/eventTime.js +127 -0
  10. package/dist/lib/groupHelpers.d.ts +63 -41
  11. package/dist/lib/groupHelpers.js +155 -45
  12. package/dist/lib/groupTemplateHelpers.d.ts +16 -0
  13. package/dist/lib/groupTemplateHelpers.js +51 -0
  14. package/dist/lib/index.d.ts +4 -0
  15. package/dist/lib/index.js +4 -0
  16. package/dist/lib/jamHelpers.d.ts +28 -2
  17. package/dist/lib/jamHelpers.js +56 -8
  18. package/dist/lib/markdownHelpers.d.ts +14 -0
  19. package/dist/lib/markdownHelpers.js +41 -0
  20. package/dist/lib/postHelpers.d.ts +22 -6
  21. package/dist/lib/postHelpers.js +49 -10
  22. package/dist/lib/pushHelpers.d.ts +3 -1
  23. package/dist/lib/pushHelpers.js +13 -0
  24. package/dist/lib/ssoLoginUrl.d.ts +24 -0
  25. package/dist/lib/ssoLoginUrl.js +75 -0
  26. package/dist/lib/text.d.ts +2 -0
  27. package/dist/lib/text.js +2 -0
  28. package/dist/lib/tokenHelpers.d.ts +5 -0
  29. package/dist/lib/tokenHelpers.js +19 -0
  30. package/dist/types/api.d.ts +2384 -350
  31. package/dist/types/api.js +43 -13
  32. package/dist/types/auth.d.ts +2 -7
  33. package/dist/types/capabilities.d.ts +11 -4
  34. package/dist/types/capabilities.js +44 -1
  35. package/dist/types/config.d.ts +15 -24
  36. package/dist/types/config.js +10 -8
  37. package/dist/types/db.d.ts +738 -66
  38. package/dist/types/db.js +3 -3
  39. package/dist/types/internal.d.ts +6189 -2604
  40. package/dist/types/internal.js +10 -1
  41. package/dist/types/models.d.ts +280 -9
  42. package/dist/types/models.js +59 -5
  43. package/dist/types/notifications.d.ts +1 -0
  44. package/dist/types/plugins.d.ts +21 -1
  45. package/dist/types/plugins.js +9 -1
  46. package/dist/types/stats.d.ts +1284 -184
  47. package/package.json +1 -1
@@ -9,7 +9,7 @@ export const groupWithMetaSchema = groupDataSchema.extend({
9
9
  });
10
10
  export const adminGroupSchema = groupWithMetaSchema.extend({
11
11
  postsCount: z.number(),
12
- admins: profileSchema.array(),
12
+ owners: profileSchema.array(),
13
13
  });
14
14
  export const membershipSchema = groupRoleSchema.extend({
15
15
  group: modelSchema(groupWithMetaSchema),
@@ -39,6 +39,10 @@ export const mentionWithProfileSchema = mentionDataSchema.extend({
39
39
  const reactionWithProfileSchema = reactionDataSchema.extend({
40
40
  profile: profileWithMetaSchema,
41
41
  });
42
+ const repostWithProfileSchema = z.object({
43
+ profile: profileWithMetaSchema,
44
+ createdAt: z.string().datetime(),
45
+ });
42
46
  const _answerWithProfileSchema = answerSchema.extend({
43
47
  profile: profileWithMetaSchema,
44
48
  });
@@ -95,6 +99,8 @@ const basePostSchema = replyPostSchema.extend({
95
99
  repostCount: z.number(),
96
100
  replyCount: z.number(),
97
101
  reactions: reactionWithProfileSchema.array(),
102
+ /** Capped lean list of who reposted (most recent). Count stays in repostCount. */
103
+ reposts: repostWithProfileSchema.array(),
98
104
  application: applicationDataSchema.optional(),
99
105
  mentions: z.array(mentionWithProfileSchema),
100
106
  tags: z.array(hashtagSchema),
@@ -104,6 +110,9 @@ const basePostSchema = replyPostSchema.extend({
104
110
  accountInteractions: accountInteractionsSchema.optional(),
105
111
  rsvps: rsvpWithMetaSchema.array(),
106
112
  seen: z.boolean().optional(),
113
+ occurrenceRecurrenceId: z.string().datetime().optional(),
114
+ occurrenceStart: z.string().datetime().optional(),
115
+ occurrenceEnd: z.string().datetime().optional(),
107
116
  });
108
117
  const withReplyPostSchema = basePostSchema.extend({
109
118
  inReplyToId: z.string().optional().nullable(),
@@ -1,6 +1,8 @@
1
1
  import { z, util, ZodObject, ZodRawShape } from 'zod';
2
2
  export declare const handleRegexBase = "[a-zA-Z0-9_-]{1,16}";
3
3
  export declare const handleRegex: RegExp;
4
+ /** `@handle` using the allowed handle charset. No `\\b` — hyphens are not word chars. */
5
+ export declare const mentionHandleRegexBase = "(^|[\\s(>])@([a-zA-Z0-9_-]{1,16})(?=\\s|$|[.,!?;:])";
4
6
  export declare const forbiddenHandles: string[];
5
7
  export declare const baseSchemaShape: {
6
8
  createdAt: z.ZodISODateTime;
@@ -228,7 +230,6 @@ export declare const profileResourceTypeSchema: z.ZodEnum<{
228
230
  self: "self";
229
231
  jams: "jams";
230
232
  profiles: "profiles";
231
- jam: "jam";
232
233
  notifications: "notifications";
233
234
  posts: "posts";
234
235
  groups: "groups";
@@ -253,7 +254,6 @@ export declare const resourceSchema: z.ZodObject<{
253
254
  jams: "jams";
254
255
  profiles: "profiles";
255
256
  "*": "*";
256
- jam: "jam";
257
257
  notifications: "notifications";
258
258
  posts: "posts";
259
259
  groups: "groups";
@@ -287,7 +287,6 @@ export declare const scopeSchema: z.ZodObject<{
287
287
  jams: "jams";
288
288
  profiles: "profiles";
289
289
  "*": "*";
290
- jam: "jam";
291
290
  notifications: "notifications";
292
291
  posts: "posts";
293
292
  groups: "groups";
@@ -376,7 +375,6 @@ export declare const profileDataSchema: z.ZodObject<{
376
375
  jams: "jams";
377
376
  profiles: "profiles";
378
377
  "*": "*";
379
- jam: "jam";
380
378
  notifications: "notifications";
381
379
  posts: "posts";
382
380
  groups: "groups";
@@ -432,7 +430,6 @@ export declare const profileSchema: z.ZodObject<{
432
430
  jams: "jams";
433
431
  profiles: "profiles";
434
432
  "*": "*";
435
- jam: "jam";
436
433
  notifications: "notifications";
437
434
  posts: "posts";
438
435
  groups: "groups";
@@ -505,7 +502,6 @@ export declare const accountWithMetaSchema: z.ZodObject<{
505
502
  jams: "jams";
506
503
  profiles: "profiles";
507
504
  "*": "*";
508
- jam: "jam";
509
505
  notifications: "notifications";
510
506
  posts: "posts";
511
507
  groups: "groups";
@@ -612,7 +608,6 @@ export declare const followSchema: z.ZodObject<{
612
608
  jams: "jams";
613
609
  profiles: "profiles";
614
610
  "*": "*";
615
- jam: "jam";
616
611
  notifications: "notifications";
617
612
  posts: "posts";
618
613
  groups: "groups";
@@ -671,7 +666,6 @@ export declare const followSchema: z.ZodObject<{
671
666
  jams: "jams";
672
667
  profiles: "profiles";
673
668
  "*": "*";
674
- jam: "jam";
675
669
  notifications: "notifications";
676
670
  posts: "posts";
677
671
  groups: "groups";
@@ -835,6 +829,8 @@ export declare const noteSchema: z.ZodObject<{
835
829
  }>>;
836
830
  }, z.core.$strip>;
837
831
  export type Note = z.infer<typeof noteSchema>;
832
+ /** Poll choices are stored short so they fit the vote UI on small screens. */
833
+ export declare const POLL_OPTION_MAX_LENGTH = 30;
838
834
  export declare const questionSchema: z.ZodObject<{
839
835
  content: z.ZodOptional<z.ZodString>;
840
836
  sensitive: z.ZodOptional<z.ZodBoolean>;
@@ -926,6 +922,58 @@ export declare const articleSchema: z.ZodObject<{
926
922
  title: z.ZodOptional<z.ZodString>;
927
923
  }, z.core.$strip>;
928
924
  export type Article = z.infer<typeof articleSchema>;
925
+ export declare const eventIsoDatetimeSchema: z.ZodISODateTime;
926
+ export declare const recurrenceFreqSchema: z.ZodEnum<{
927
+ DAILY: "DAILY";
928
+ WEEKLY: "WEEKLY";
929
+ MONTHLY: "MONTHLY";
930
+ }>;
931
+ export type RecurrenceFreq = z.infer<typeof recurrenceFreqSchema>;
932
+ export declare const recurrenceWeekdaySchema: z.ZodEnum<{
933
+ MO: "MO";
934
+ TU: "TU";
935
+ WE: "WE";
936
+ TH: "TH";
937
+ FR: "FR";
938
+ SA: "SA";
939
+ SU: "SU";
940
+ }>;
941
+ export type RecurrenceWeekday = z.infer<typeof recurrenceWeekdaySchema>;
942
+ export declare const eventRecurrenceSchema: z.ZodObject<{
943
+ freq: z.ZodEnum<{
944
+ DAILY: "DAILY";
945
+ WEEKLY: "WEEKLY";
946
+ MONTHLY: "MONTHLY";
947
+ }>;
948
+ interval: z.ZodOptional<z.ZodNumber>;
949
+ byDay: z.ZodOptional<z.ZodArray<z.ZodEnum<{
950
+ MO: "MO";
951
+ TU: "TU";
952
+ WE: "WE";
953
+ TH: "TH";
954
+ FR: "FR";
955
+ SA: "SA";
956
+ SU: "SU";
957
+ }>>>;
958
+ until: z.ZodOptional<z.ZodISODateTime>;
959
+ count: z.ZodOptional<z.ZodNumber>;
960
+ }, z.core.$strip>;
961
+ export type EventRecurrence = z.infer<typeof eventRecurrenceSchema>;
962
+ export declare const eventOccurrenceExceptionSchema: z.ZodObject<{
963
+ recurrenceId: z.ZodISODateTime;
964
+ cancelled: z.ZodOptional<z.ZodBoolean>;
965
+ start: z.ZodOptional<z.ZodISODateTime>;
966
+ end: z.ZodOptional<z.ZodISODateTime>;
967
+ physicalLocation: z.ZodOptional<z.ZodObject<{
968
+ text: z.ZodString;
969
+ coordinates: z.ZodOptional<z.ZodObject<{
970
+ lat: z.ZodNumber;
971
+ lng: z.ZodNumber;
972
+ alt: z.ZodOptional<z.ZodNumber>;
973
+ }, z.core.$strip>>;
974
+ }, z.core.$strip>>;
975
+ }, z.core.$strip>;
976
+ export type EventOccurrenceException = z.infer<typeof eventOccurrenceExceptionSchema>;
929
977
  export declare const eventSchema: z.ZodObject<{
930
978
  content: z.ZodOptional<z.ZodString>;
931
979
  sensitive: z.ZodOptional<z.ZodBoolean>;
@@ -997,6 +1045,39 @@ export declare const eventSchema: z.ZodObject<{
997
1045
  }, z.core.$strip>>;
998
1046
  }, z.core.$strip>>;
999
1047
  url: z.ZodOptional<z.ZodURL>;
1048
+ recurrence: z.ZodOptional<z.ZodObject<{
1049
+ freq: z.ZodEnum<{
1050
+ DAILY: "DAILY";
1051
+ WEEKLY: "WEEKLY";
1052
+ MONTHLY: "MONTHLY";
1053
+ }>;
1054
+ interval: z.ZodOptional<z.ZodNumber>;
1055
+ byDay: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1056
+ MO: "MO";
1057
+ TU: "TU";
1058
+ WE: "WE";
1059
+ TH: "TH";
1060
+ FR: "FR";
1061
+ SA: "SA";
1062
+ SU: "SU";
1063
+ }>>>;
1064
+ until: z.ZodOptional<z.ZodISODateTime>;
1065
+ count: z.ZodOptional<z.ZodNumber>;
1066
+ }, z.core.$strip>>;
1067
+ exceptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
1068
+ recurrenceId: z.ZodISODateTime;
1069
+ cancelled: z.ZodOptional<z.ZodBoolean>;
1070
+ start: z.ZodOptional<z.ZodISODateTime>;
1071
+ end: z.ZodOptional<z.ZodISODateTime>;
1072
+ physicalLocation: z.ZodOptional<z.ZodObject<{
1073
+ text: z.ZodString;
1074
+ coordinates: z.ZodOptional<z.ZodObject<{
1075
+ lat: z.ZodNumber;
1076
+ lng: z.ZodNumber;
1077
+ alt: z.ZodOptional<z.ZodNumber>;
1078
+ }, z.core.$strip>>;
1079
+ }, z.core.$strip>>;
1080
+ }, z.core.$strip>>>;
1000
1081
  }, z.core.$strip>;
1001
1082
  export type Event = z.infer<typeof eventSchema>;
1002
1083
  export type EventWithId = z.infer<typeof eventSchema> & {
@@ -1158,6 +1239,39 @@ export declare const postDataUnionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1158
1239
  }, z.core.$strip>>;
1159
1240
  }, z.core.$strip>>;
1160
1241
  url: z.ZodOptional<z.ZodURL>;
1242
+ recurrence: z.ZodOptional<z.ZodObject<{
1243
+ freq: z.ZodEnum<{
1244
+ DAILY: "DAILY";
1245
+ WEEKLY: "WEEKLY";
1246
+ MONTHLY: "MONTHLY";
1247
+ }>;
1248
+ interval: z.ZodOptional<z.ZodNumber>;
1249
+ byDay: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1250
+ MO: "MO";
1251
+ TU: "TU";
1252
+ WE: "WE";
1253
+ TH: "TH";
1254
+ FR: "FR";
1255
+ SA: "SA";
1256
+ SU: "SU";
1257
+ }>>>;
1258
+ until: z.ZodOptional<z.ZodISODateTime>;
1259
+ count: z.ZodOptional<z.ZodNumber>;
1260
+ }, z.core.$strip>>;
1261
+ exceptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
1262
+ recurrenceId: z.ZodISODateTime;
1263
+ cancelled: z.ZodOptional<z.ZodBoolean>;
1264
+ start: z.ZodOptional<z.ZodISODateTime>;
1265
+ end: z.ZodOptional<z.ZodISODateTime>;
1266
+ physicalLocation: z.ZodOptional<z.ZodObject<{
1267
+ text: z.ZodString;
1268
+ coordinates: z.ZodOptional<z.ZodObject<{
1269
+ lat: z.ZodNumber;
1270
+ lng: z.ZodNumber;
1271
+ alt: z.ZodOptional<z.ZodNumber>;
1272
+ }, z.core.$strip>>;
1273
+ }, z.core.$strip>>;
1274
+ }, z.core.$strip>>>;
1161
1275
  }, z.core.$strip>, z.ZodObject<{
1162
1276
  content: z.ZodOptional<z.ZodString>;
1163
1277
  sensitive: z.ZodOptional<z.ZodBoolean>;
@@ -1374,6 +1488,39 @@ export declare const postDataSchema: z.ZodObject<{
1374
1488
  }, z.core.$strip>>;
1375
1489
  }, z.core.$strip>>;
1376
1490
  url: z.ZodOptional<z.ZodURL>;
1491
+ recurrence: z.ZodOptional<z.ZodObject<{
1492
+ freq: z.ZodEnum<{
1493
+ DAILY: "DAILY";
1494
+ WEEKLY: "WEEKLY";
1495
+ MONTHLY: "MONTHLY";
1496
+ }>;
1497
+ interval: z.ZodOptional<z.ZodNumber>;
1498
+ byDay: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1499
+ MO: "MO";
1500
+ TU: "TU";
1501
+ WE: "WE";
1502
+ TH: "TH";
1503
+ FR: "FR";
1504
+ SA: "SA";
1505
+ SU: "SU";
1506
+ }>>>;
1507
+ until: z.ZodOptional<z.ZodISODateTime>;
1508
+ count: z.ZodOptional<z.ZodNumber>;
1509
+ }, z.core.$strip>>;
1510
+ exceptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
1511
+ recurrenceId: z.ZodISODateTime;
1512
+ cancelled: z.ZodOptional<z.ZodBoolean>;
1513
+ start: z.ZodOptional<z.ZodISODateTime>;
1514
+ end: z.ZodOptional<z.ZodISODateTime>;
1515
+ physicalLocation: z.ZodOptional<z.ZodObject<{
1516
+ text: z.ZodString;
1517
+ coordinates: z.ZodOptional<z.ZodObject<{
1518
+ lat: z.ZodNumber;
1519
+ lng: z.ZodNumber;
1520
+ alt: z.ZodOptional<z.ZodNumber>;
1521
+ }, z.core.$strip>>;
1522
+ }, z.core.$strip>>;
1523
+ }, z.core.$strip>>>;
1377
1524
  }, z.core.$strip>, z.ZodObject<{
1378
1525
  content: z.ZodOptional<z.ZodString>;
1379
1526
  sensitive: z.ZodOptional<z.ZodBoolean>;
@@ -1592,6 +1739,39 @@ export declare const postSchema: z.ZodObject<{
1592
1739
  }, z.core.$strip>>;
1593
1740
  }, z.core.$strip>>;
1594
1741
  url: z.ZodOptional<z.ZodURL>;
1742
+ recurrence: z.ZodOptional<z.ZodObject<{
1743
+ freq: z.ZodEnum<{
1744
+ DAILY: "DAILY";
1745
+ WEEKLY: "WEEKLY";
1746
+ MONTHLY: "MONTHLY";
1747
+ }>;
1748
+ interval: z.ZodOptional<z.ZodNumber>;
1749
+ byDay: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1750
+ MO: "MO";
1751
+ TU: "TU";
1752
+ WE: "WE";
1753
+ TH: "TH";
1754
+ FR: "FR";
1755
+ SA: "SA";
1756
+ SU: "SU";
1757
+ }>>>;
1758
+ until: z.ZodOptional<z.ZodISODateTime>;
1759
+ count: z.ZodOptional<z.ZodNumber>;
1760
+ }, z.core.$strip>>;
1761
+ exceptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
1762
+ recurrenceId: z.ZodISODateTime;
1763
+ cancelled: z.ZodOptional<z.ZodBoolean>;
1764
+ start: z.ZodOptional<z.ZodISODateTime>;
1765
+ end: z.ZodOptional<z.ZodISODateTime>;
1766
+ physicalLocation: z.ZodOptional<z.ZodObject<{
1767
+ text: z.ZodString;
1768
+ coordinates: z.ZodOptional<z.ZodObject<{
1769
+ lat: z.ZodNumber;
1770
+ lng: z.ZodNumber;
1771
+ alt: z.ZodOptional<z.ZodNumber>;
1772
+ }, z.core.$strip>>;
1773
+ }, z.core.$strip>>;
1774
+ }, z.core.$strip>>>;
1595
1775
  }, z.core.$strip>, z.ZodObject<{
1596
1776
  content: z.ZodOptional<z.ZodString>;
1597
1777
  sensitive: z.ZodOptional<z.ZodBoolean>;
@@ -1659,6 +1839,7 @@ export declare const rsvpSchema: z.ZodObject<{
1659
1839
  tentative: "tentative";
1660
1840
  removed: "removed";
1661
1841
  }>;
1842
+ recurrenceId: z.ZodOptional<z.ZodISODateTime>;
1662
1843
  }, z.core.$strip>;
1663
1844
  export type RSVP = z.infer<typeof rsvpSchema>;
1664
1845
  export declare const entryDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -1819,6 +2000,39 @@ export declare const entryDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1819
2000
  }, z.core.$strip>>;
1820
2001
  }, z.core.$strip>>;
1821
2002
  url: z.ZodOptional<z.ZodURL>;
2003
+ recurrence: z.ZodOptional<z.ZodObject<{
2004
+ freq: z.ZodEnum<{
2005
+ DAILY: "DAILY";
2006
+ WEEKLY: "WEEKLY";
2007
+ MONTHLY: "MONTHLY";
2008
+ }>;
2009
+ interval: z.ZodOptional<z.ZodNumber>;
2010
+ byDay: z.ZodOptional<z.ZodArray<z.ZodEnum<{
2011
+ MO: "MO";
2012
+ TU: "TU";
2013
+ WE: "WE";
2014
+ TH: "TH";
2015
+ FR: "FR";
2016
+ SA: "SA";
2017
+ SU: "SU";
2018
+ }>>>;
2019
+ until: z.ZodOptional<z.ZodISODateTime>;
2020
+ count: z.ZodOptional<z.ZodNumber>;
2021
+ }, z.core.$strip>>;
2022
+ exceptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
2023
+ recurrenceId: z.ZodISODateTime;
2024
+ cancelled: z.ZodOptional<z.ZodBoolean>;
2025
+ start: z.ZodOptional<z.ZodISODateTime>;
2026
+ end: z.ZodOptional<z.ZodISODateTime>;
2027
+ physicalLocation: z.ZodOptional<z.ZodObject<{
2028
+ text: z.ZodString;
2029
+ coordinates: z.ZodOptional<z.ZodObject<{
2030
+ lat: z.ZodNumber;
2031
+ lng: z.ZodNumber;
2032
+ alt: z.ZodOptional<z.ZodNumber>;
2033
+ }, z.core.$strip>>;
2034
+ }, z.core.$strip>>;
2035
+ }, z.core.$strip>>>;
1822
2036
  }, z.core.$strip>, z.ZodObject<{
1823
2037
  content: z.ZodOptional<z.ZodString>;
1824
2038
  sensitive: z.ZodOptional<z.ZodBoolean>;
@@ -2019,6 +2233,39 @@ export declare const entryDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2019
2233
  }, z.core.$strip>>;
2020
2234
  }, z.core.$strip>>;
2021
2235
  url: z.ZodOptional<z.ZodURL>;
2236
+ recurrence: z.ZodOptional<z.ZodObject<{
2237
+ freq: z.ZodEnum<{
2238
+ DAILY: "DAILY";
2239
+ WEEKLY: "WEEKLY";
2240
+ MONTHLY: "MONTHLY";
2241
+ }>;
2242
+ interval: z.ZodOptional<z.ZodNumber>;
2243
+ byDay: z.ZodOptional<z.ZodArray<z.ZodEnum<{
2244
+ MO: "MO";
2245
+ TU: "TU";
2246
+ WE: "WE";
2247
+ TH: "TH";
2248
+ FR: "FR";
2249
+ SA: "SA";
2250
+ SU: "SU";
2251
+ }>>>;
2252
+ until: z.ZodOptional<z.ZodISODateTime>;
2253
+ count: z.ZodOptional<z.ZodNumber>;
2254
+ }, z.core.$strip>>;
2255
+ exceptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
2256
+ recurrenceId: z.ZodISODateTime;
2257
+ cancelled: z.ZodOptional<z.ZodBoolean>;
2258
+ start: z.ZodOptional<z.ZodISODateTime>;
2259
+ end: z.ZodOptional<z.ZodISODateTime>;
2260
+ physicalLocation: z.ZodOptional<z.ZodObject<{
2261
+ text: z.ZodString;
2262
+ coordinates: z.ZodOptional<z.ZodObject<{
2263
+ lat: z.ZodNumber;
2264
+ lng: z.ZodNumber;
2265
+ alt: z.ZodOptional<z.ZodNumber>;
2266
+ }, z.core.$strip>>;
2267
+ }, z.core.$strip>>;
2268
+ }, z.core.$strip>>>;
2022
2269
  }, z.core.$strip>, z.ZodObject<{
2023
2270
  content: z.ZodOptional<z.ZodString>;
2024
2271
  sensitive: z.ZodOptional<z.ZodBoolean>;
@@ -2078,6 +2325,7 @@ export declare const entryDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2078
2325
  tentative: "tentative";
2079
2326
  removed: "removed";
2080
2327
  }>;
2328
+ recurrenceId: z.ZodOptional<z.ZodISODateTime>;
2081
2329
  }, z.core.$strip>;
2082
2330
  }, z.core.$strip>], "type">;
2083
2331
  export type EntryData = z.infer<typeof entryDataSchema>;
@@ -2396,6 +2644,7 @@ export declare const profileStatsSchema: z.ZodObject<{
2396
2644
  followingCount: z.ZodNumber;
2397
2645
  }, z.core.$strip>;
2398
2646
  export type ProfileStats = z.infer<typeof profileStatsSchema>;
2647
+ export declare const GROUP_DISPLAY_NAME_MAX_LENGTH = 30;
2399
2648
  export declare const groupDataSchema: z.ZodObject<{
2400
2649
  handle: z.ZodString;
2401
2650
  avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -2435,8 +2684,9 @@ export declare const groupRoleSchema: z.ZodObject<{
2435
2684
  none: "none";
2436
2685
  local: "local";
2437
2686
  member: "member";
2438
- admin: "admin";
2439
2687
  moderator: "moderator";
2688
+ admin: "admin";
2689
+ owner: "owner";
2440
2690
  invited: "invited";
2441
2691
  }>>>>;
2442
2692
  }, z.core.$strip>;
@@ -2458,12 +2708,15 @@ export declare const jamEventDataSchema: z.ZodObject<{
2458
2708
  close: "close";
2459
2709
  recordStart: "recordStart";
2460
2710
  recordStop: "recordStop";
2711
+ streamStart: "streamStart";
2712
+ streamStop: "streamStop";
2461
2713
  }>;
2462
2714
  profileId: z.ZodString;
2463
2715
  content: z.ZodOptional<z.ZodString>;
2464
2716
  reaction: z.ZodOptional<z.ZodEnum<{
2465
2717
  "\uD83D\uDC4D": "👍";
2466
2718
  }>>;
2719
+ recurrenceId: z.ZodOptional<z.ZodISODateTime>;
2467
2720
  }, z.core.$strip>;
2468
2721
  export type JamEventData = z.infer<typeof jamEventDataSchema>;
2469
2722
  export declare const jamEventSchema: z.ZodObject<{
@@ -2477,12 +2730,15 @@ export declare const jamEventSchema: z.ZodObject<{
2477
2730
  close: "close";
2478
2731
  recordStart: "recordStart";
2479
2732
  recordStop: "recordStop";
2733
+ streamStart: "streamStart";
2734
+ streamStop: "streamStop";
2480
2735
  }>;
2481
2736
  profileId: z.ZodString;
2482
2737
  content: z.ZodOptional<z.ZodString>;
2483
2738
  reaction: z.ZodOptional<z.ZodEnum<{
2484
2739
  "\uD83D\uDC4D": "👍";
2485
2740
  }>>;
2741
+ recurrenceId: z.ZodOptional<z.ZodISODateTime>;
2486
2742
  id: z.ZodUUID;
2487
2743
  createdAt: z.ZodISODateTime;
2488
2744
  updatedAt: z.ZodISODateTime;
@@ -2534,6 +2790,11 @@ export declare const jamRecordingTypeSchema: z.ZodEnum<{
2534
2790
  streams: "streams";
2535
2791
  }>;
2536
2792
  export type JamRecordingType = z.infer<typeof jamRecordingTypeSchema>;
2793
+ export declare const jamRecordingKindSchema: z.ZodEnum<{
2794
+ file: "file";
2795
+ rtmp: "rtmp";
2796
+ }>;
2797
+ export type JamRecordingKind = z.infer<typeof jamRecordingKindSchema>;
2537
2798
  export declare const jamRecordingDataSchema: z.ZodObject<{
2538
2799
  status: z.ZodEnum<{
2539
2800
  active: "active";
@@ -2541,6 +2802,11 @@ export declare const jamRecordingDataSchema: z.ZodObject<{
2541
2802
  requested: "requested";
2542
2803
  completed: "completed";
2543
2804
  }>;
2805
+ kind: z.ZodOptional<z.ZodEnum<{
2806
+ file: "file";
2807
+ rtmp: "rtmp";
2808
+ }>>;
2809
+ destinationHost: z.ZodOptional<z.ZodString>;
2544
2810
  egressId: z.ZodOptional<z.ZodString>;
2545
2811
  attachment: z.ZodOptional<z.ZodObject<{
2546
2812
  type: z.ZodString;
@@ -2580,6 +2846,11 @@ export declare const jamRecordingSchema: z.ZodObject<{
2580
2846
  requested: "requested";
2581
2847
  completed: "completed";
2582
2848
  }>;
2849
+ kind: z.ZodOptional<z.ZodEnum<{
2850
+ file: "file";
2851
+ rtmp: "rtmp";
2852
+ }>>;
2853
+ destinationHost: z.ZodOptional<z.ZodString>;
2583
2854
  egressId: z.ZodOptional<z.ZodString>;
2584
2855
  attachment: z.ZodOptional<z.ZodObject<{
2585
2856
  type: z.ZodString;
@@ -7,6 +7,8 @@ import { capabilitiesSchema } from './config.js';
7
7
  extendZodWithOpenApi(z);
8
8
  export const handleRegexBase = '[a-zA-Z0-9_-]{1,16}';
9
9
  export const handleRegex = new RegExp(`^${handleRegexBase}$`);
10
+ /** `@handle` using the allowed handle charset. No `\\b` — hyphens are not word chars. */
11
+ export const mentionHandleRegexBase = `(^|[\\s(>])@(${handleRegexBase})(?=\\s|$|[.,!?;:])`;
10
12
  export const forbiddenHandles = [
11
13
  'admin',
12
14
  'allpeep',
@@ -148,7 +150,6 @@ export const accountNameSchema = z
148
150
  description: 'Account handle: 1-16 alphanumeric / underscore / hyphen characters, excluding a reserved set.',
149
151
  });
150
152
  const profileResourceTypes = [
151
- 'jam',
152
153
  'jams',
153
154
  'posts',
154
155
  'self',
@@ -333,12 +334,14 @@ export const noteSchema = z
333
334
  language: z.enum(ISO6391.getAllCodes()).optional(),
334
335
  })
335
336
  .openapi('Note');
337
+ /** Poll choices are stored short so they fit the vote UI on small screens. */
338
+ export const POLL_OPTION_MAX_LENGTH = 30;
336
339
  export const questionSchema = noteSchema
337
340
  .extend({
338
341
  type: z.literal('question'),
339
342
  options: z
340
343
  .object({
341
- content: z.string().max(30),
344
+ content: z.string().max(POLL_OPTION_MAX_LENGTH),
342
345
  type: z.literal('note'),
343
346
  })
344
347
  .array(),
@@ -354,14 +357,50 @@ export const articleSchema = noteSchema
354
357
  title: z.string().optional(),
355
358
  })
356
359
  .openapi('Article');
360
+ export const eventIsoDatetimeSchema = z.iso.datetime({
361
+ offset: true,
362
+ precision: 3,
363
+ });
364
+ export const recurrenceFreqSchema = z.enum(['DAILY', 'WEEKLY', 'MONTHLY']);
365
+ export const recurrenceWeekdaySchema = z.enum([
366
+ 'MO',
367
+ 'TU',
368
+ 'WE',
369
+ 'TH',
370
+ 'FR',
371
+ 'SA',
372
+ 'SU',
373
+ ]);
374
+ export const eventRecurrenceSchema = z
375
+ .object({
376
+ freq: recurrenceFreqSchema,
377
+ interval: z.number().int().positive().optional(),
378
+ byDay: recurrenceWeekdaySchema.array().optional(),
379
+ until: eventIsoDatetimeSchema.optional(),
380
+ count: z.number().int().positive().optional(),
381
+ })
382
+ .refine((value) => !(value.until && value.count), {
383
+ message: 'until and count are mutually exclusive',
384
+ path: ['until'],
385
+ })
386
+ .openapi('EventRecurrence');
387
+ export const eventOccurrenceExceptionSchema = z
388
+ .object({
389
+ recurrenceId: eventIsoDatetimeSchema,
390
+ cancelled: z.boolean().optional(),
391
+ start: eventIsoDatetimeSchema.optional(),
392
+ end: eventIsoDatetimeSchema.optional(),
393
+ physicalLocation: locationSchema.optional(),
394
+ })
395
+ .openapi('EventOccurrenceException');
357
396
  export const eventSchema = noteSchema
358
397
  .extend({
359
398
  type: z.literal('event'),
360
399
  name: z.string().optional(),
361
400
  timeZone: z.string().optional(),
362
401
  image: z.url().optional(),
363
- start: z.iso.datetime({ offset: true, precision: 3 }),
364
- end: z.iso.datetime({ offset: true, precision: 3 }).optional(),
402
+ start: eventIsoDatetimeSchema,
403
+ end: eventIsoDatetimeSchema.optional(),
365
404
  wholeDay: z.boolean(),
366
405
  maxAttendees: z.number().int().positive().optional(),
367
406
  attendeeListPublic: z.boolean().optional(),
@@ -369,6 +408,8 @@ export const eventSchema = noteSchema
369
408
  jam: jamSchema.optional(),
370
409
  physicalLocation: locationSchema.optional(),
371
410
  url: z.url().optional(),
411
+ recurrence: eventRecurrenceSchema.optional(),
412
+ exceptions: eventOccurrenceExceptionSchema.array().optional(),
372
413
  })
373
414
  .openapi('Event');
374
415
  export const postDataUnionSchema = z.discriminatedUnion('type', [
@@ -393,6 +434,7 @@ export const answerSchema = z
393
434
  export const rsvpResponseSchema = z.enum(['yes', 'no', 'tentative', 'removed']);
394
435
  export const rsvpSchema = z.object({
395
436
  response: rsvpResponseSchema,
437
+ recurrenceId: eventIsoDatetimeSchema.optional(),
396
438
  });
397
439
  export const entryDataSchema = z.discriminatedUnion('type', [
398
440
  z.object({
@@ -530,11 +572,17 @@ export const profileStatsSchema = z.object({
530
572
  followersCount: z.number(),
531
573
  followingCount: z.number(),
532
574
  });
575
+ export const GROUP_DISPLAY_NAME_MAX_LENGTH = 30;
533
576
  export const groupDataSchema = z.object({
534
577
  handle: accountNameSchema,
535
578
  avatar: z.string().url().nullable().optional(),
536
579
  header: z.string().url().nullable().optional(),
537
- displayName: z.string().max(30).optional(),
580
+ displayName: z
581
+ .string()
582
+ .max(GROUP_DISPLAY_NAME_MAX_LENGTH, {
583
+ message: `Group name should be ${GROUP_DISPLAY_NAME_MAX_LENGTH} characters or fewer`,
584
+ })
585
+ .optional(),
538
586
  description: z.string().optional(),
539
587
  rules: z.string().optional(),
540
588
  pinnedPostId: z.string().optional(),
@@ -561,10 +609,13 @@ export const jamEventDataSchema = z.object({
561
609
  'close',
562
610
  'recordStart',
563
611
  'recordStop',
612
+ 'streamStart',
613
+ 'streamStop',
564
614
  ]),
565
615
  profileId: z.string(),
566
616
  content: z.string().optional(),
567
617
  reaction: reactionTypeSchema.optional(),
618
+ recurrenceId: eventIsoDatetimeSchema.optional(),
568
619
  });
569
620
  export const jamEventSchema = modelSchema(jamEventDataSchema);
570
621
  export const inviteLinkDataSchema = z.object({
@@ -590,8 +641,11 @@ export const jamRecordingTypeSchema = z.enum([
590
641
  'compositeAudio',
591
642
  'streams',
592
643
  ]);
644
+ export const jamRecordingKindSchema = z.enum(['file', 'rtmp']);
593
645
  export const jamRecordingDataSchema = z.object({
594
646
  status: z.enum(['requested', 'active', 'completed', 'failed']),
647
+ kind: jamRecordingKindSchema.optional(),
648
+ destinationHost: z.string().optional(),
595
649
  egressId: z.string().optional(),
596
650
  attachment: mediaAttachmentSchema.optional(),
597
651
  replyPostId: z.string().optional(),
@@ -165,6 +165,7 @@ export declare const notificationTypeSchema: z.ZodObject<{
165
165
  "core-inviteLinks-update": "core-inviteLinks-update";
166
166
  "core-inviteLinks-delete": "core-inviteLinks-delete";
167
167
  "core-serviceTokens-update": "core-serviceTokens-update";
168
+ "core-plugins-manage": "core-plugins-manage";
168
169
  }>>>;
169
170
  defaultSettings: z.ZodOptional<z.ZodObject<{
170
171
  create: z.ZodBoolean;