@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
package/dist/types/api.js CHANGED
@@ -92,6 +92,10 @@ export const entryWithPublicProfileSchema = z.discriminatedUnion('type', [
92
92
  const reactionWithPublicProfileSchema = reactionDataSchema.extend({
93
93
  profile: publicProfileSchema,
94
94
  });
95
+ const repostWithPublicProfileSchema = z.object({
96
+ profile: publicProfileSchema,
97
+ createdAt: z.string().datetime(),
98
+ });
95
99
  export const publicReplyPostSchema = z.object({
96
100
  id: z.string(),
97
101
  type: postTypeSchema,
@@ -116,6 +120,8 @@ const basePublicPostSchema = publicReplyPostSchema.extend({
116
120
  repostCount: z.number(),
117
121
  replyCount: z.number(),
118
122
  reactions: reactionWithPublicProfileSchema.array(),
123
+ /** Capped lean list of who reposted (most recent). Count stays in repostCount. */
124
+ reposts: repostWithPublicProfileSchema.array(),
119
125
  application: publicApplicationSchema.optional(),
120
126
  mentions: z.array(mentionWithPublicProfileSchema),
121
127
  tags: z.array(hashtagSchema),
@@ -125,6 +131,9 @@ const basePublicPostSchema = publicReplyPostSchema.extend({
125
131
  accountInteractions: accountInteractionsSchema.optional(),
126
132
  rsvps: publicRsvpSchema.array(),
127
133
  seen: z.boolean().optional(),
134
+ occurrenceRecurrenceId: z.string().datetime().optional(),
135
+ occurrenceStart: z.string().datetime().optional(),
136
+ occurrenceEnd: z.string().datetime().optional(),
128
137
  });
129
138
  const withReplyPostSchema = basePublicPostSchema.extend({
130
139
  inReplyToId: z.string().optional().nullable(),
@@ -183,6 +192,8 @@ export const serverInfoSchema = z.object({
183
192
  version: z.string(),
184
193
  environment: z.string(),
185
194
  publicContent: z.boolean(),
195
+ /** Latest post view (`post_seen.created_at`); null if none yet. */
196
+ lastAccessed: z.iso.datetime().nullable(),
186
197
  maxProfiles: z.number().int().nonnegative().optional(),
187
198
  communityConfig: communityConfigSchema,
188
199
  jams: z.object({
@@ -207,12 +218,20 @@ export const serverInfoSchema = z.object({
207
218
  }),
208
219
  }),
209
220
  }),
210
- sso: z.object({
221
+ sso: z
222
+ .object({
223
+ onlySSO: z.boolean().optional(),
224
+ generic: z.array(z.object({
225
+ id: z.string(),
226
+ name: z.string(),
227
+ loginLink: z.string(),
228
+ })),
211
229
  oidc: z.array(z.object({
212
230
  id: z.string(),
213
231
  name: z.string(),
214
232
  })),
215
- }).optional(),
233
+ })
234
+ .optional(),
216
235
  });
217
236
  export const unseenPostCountsSchema = z.object({
218
237
  groups: z.record(z.string(), z.number()),
@@ -333,9 +352,10 @@ const focusCoordinatesPattern = /^-?\d+,-?\d+$/;
333
352
  // they actually got a `File` / `Blob` instance.
334
353
  export const mediaStorageRequestSchema = z.object({
335
354
  description: z.string().optional(),
336
- file: z
337
- .any()
338
- .openapi({ type: 'string', format: 'binary' }),
355
+ file: z.any().openapi({
356
+ type: 'string',
357
+ format: 'binary',
358
+ }),
339
359
  thumbnail: z
340
360
  .any()
341
361
  .optional()
@@ -448,19 +468,19 @@ export const postCreationDataSchema = z.object({
448
468
  });
449
469
  export const postCreationDataFormSchema = postCreationDataSchema
450
470
  .refine((data) => {
451
- if (data.type !== "event")
471
+ if (data.type !== 'event')
452
472
  return true;
453
- if (data.data.type !== "event")
473
+ if (data.data.type !== 'event')
454
474
  return true;
455
475
  return !!data.data.name;
456
476
  }, {
457
- message: "Name is required",
458
- path: ["data", "name"],
477
+ message: 'Name is required',
478
+ path: ['data', 'name'],
459
479
  })
460
480
  .refine((data) => {
461
- if (data.type !== "event")
481
+ if (data.type !== 'event')
462
482
  return true;
463
- if (data.data.type !== "event")
483
+ if (data.data.type !== 'event')
464
484
  return true;
465
485
  const { start, end } = data.data;
466
486
  if (end && start && new Date(end) < new Date(start)) {
@@ -468,8 +488,8 @@ export const postCreationDataFormSchema = postCreationDataSchema
468
488
  }
469
489
  return true;
470
490
  }, {
471
- message: "End date cannot be before start date",
472
- path: ["data", "end"],
491
+ message: 'End date cannot be before start date',
492
+ path: ['data', 'end'],
473
493
  });
474
494
  const answerWithPublicProfileSchema = answerSchema.extend({
475
495
  profile: publicProfileSchema,
@@ -480,6 +500,16 @@ export const paymentCheckoutSchema = successFailureResponseSchema.extend({
480
500
  export const jamObserverResponseSchema = z.object({
481
501
  path: z.string().optional(),
482
502
  });
503
+ export const jamRtmpStreamRequestSchema = z.object({
504
+ url: z.string().min(1),
505
+ streamKey: z.string().min(1),
506
+ });
507
+ export const jamRtmpStreamResponseSchema = z.object({
508
+ id: z.string(),
509
+ status: z.enum(['requested', 'active', 'completed', 'failed']),
510
+ destinationHost: z.string().optional(),
511
+ egressId: z.string().optional(),
512
+ });
483
513
  export const accessTokenCreationDataSchema = z.object({
484
514
  name: z.string(),
485
515
  description: z.string().optional(),
@@ -18,7 +18,6 @@ export declare const authorizationSchema: z.ZodObject<{
18
18
  jams: "jams";
19
19
  profiles: "profiles";
20
20
  "*": "*";
21
- jam: "jam";
22
21
  notifications: "notifications";
23
22
  posts: "posts";
24
23
  groups: "groups";
@@ -75,7 +74,6 @@ export declare const authorizationDataSchema: z.ZodObject<{
75
74
  jams: "jams";
76
75
  profiles: "profiles";
77
76
  "*": "*";
78
- jam: "jam";
79
77
  notifications: "notifications";
80
78
  posts: "posts";
81
79
  groups: "groups";
@@ -143,7 +141,6 @@ export declare const authorizationDataSchema: z.ZodObject<{
143
141
  jams: "jams";
144
142
  profiles: "profiles";
145
143
  "*": "*";
146
- jam: "jam";
147
144
  notifications: "notifications";
148
145
  posts: "posts";
149
146
  groups: "groups";
@@ -202,7 +199,6 @@ export declare const authorizationDataSchema: z.ZodObject<{
202
199
  jams: "jams";
203
200
  profiles: "profiles";
204
201
  "*": "*";
205
- jam: "jam";
206
202
  notifications: "notifications";
207
203
  posts: "posts";
208
204
  groups: "groups";
@@ -234,8 +230,9 @@ export declare const authorizationDataSchema: z.ZodObject<{
234
230
  none: "none";
235
231
  local: "local";
236
232
  member: "member";
237
- admin: "admin";
238
233
  moderator: "moderator";
234
+ admin: "admin";
235
+ owner: "owner";
239
236
  invited: "invited";
240
237
  }>>>>;
241
238
  group: z.ZodObject<{
@@ -319,7 +316,6 @@ export declare const authorizationDataSchema: z.ZodObject<{
319
316
  jams: "jams";
320
317
  profiles: "profiles";
321
318
  "*": "*";
322
- jam: "jam";
323
319
  notifications: "notifications";
324
320
  posts: "posts";
325
321
  groups: "groups";
@@ -351,7 +347,6 @@ export declare const authorizationDataSchema: z.ZodObject<{
351
347
  jams: "jams";
352
348
  profiles: "profiles";
353
349
  "*": "*";
354
- jam: "jam";
355
350
  notifications: "notifications";
356
351
  posts: "posts";
357
352
  groups: "groups";
@@ -1,7 +1,7 @@
1
1
  export type ObjectType = 'post' | 'group' | 'profile' | 'report' | 'community' | 'accessToken';
2
2
  export declare const postRelationships: readonly ["none", "local", "audience", "mentioned", "attendee", "collaborator"];
3
- export declare const defaultGroupRoles: readonly ["member", "admin", "moderator"];
4
- export declare const groupRelationships: readonly ["member", "admin", "moderator", "none", "local", "invited"];
3
+ export declare const defaultGroupRoles: readonly ["member", "moderator", "admin", "owner"];
4
+ export declare const groupRelationships: readonly ["member", "moderator", "admin", "owner", "none", "local", "invited"];
5
5
  export declare const profileRelationships: readonly ["none", "local", "self", "following", "followed-by", "blocked-by", "muted-by"];
6
6
  export declare const reportRelationships: readonly ["none", "local", "reporter", "reported", "acted-on"];
7
7
  export declare const accessTokenRelationships: readonly ["none", "local", "owner"];
@@ -11,7 +11,14 @@ export type ProfileRelationship = (typeof profileRelationships)[number];
11
11
  export type ReportRelationship = (typeof reportRelationships)[number];
12
12
  export type AccessTokenRelationship = (typeof accessTokenRelationships)[number];
13
13
  export declare const postCapabilities: readonly ["core-posts-read", "core-posts-update", "core-posts-delete", "core-posts-vote", "core-posts-react", "core-posts-rsvp", "core-posts-reply", "core-posts-jam-moderate", "core-posts-jam-speak", "core-posts-jam-read"];
14
- export declare const groupCapabilities: readonly ["core-groups-read", "core-groups-update", "core-groups-delete", "core-groups-join", "core-groups-leave", "core-groups-addMember", "core-groups-removeMember", "core-groups-changeMemberRole", "core-posts-create-note", "core-posts-create-event", "core-posts-create-poll", "core-posts-create-article"];
14
+ export declare const groupCapabilities: readonly ["core-groups-read", "core-groups-update", "core-groups-updateCapabilities", "core-groups-delete", "core-groups-join", "core-groups-leave", "core-groups-addMember", "core-groups-removeMember", "core-groups-changeMemberRole", "core-posts-create-note", "core-posts-create-event", "core-posts-create-poll", "core-posts-create-article"];
15
+ /** Caps an owner can toggle per relationship in the group editor. */
16
+ export declare const groupCapabilityEditorKeys: readonly ["core-groups-read", "core-groups-update", "core-groups-updateCapabilities", "core-groups-delete", "core-groups-join", "core-groups-leave", "core-groups-addMember", "core-groups-removeMember", "core-groups-changeMemberRole", "core-posts-create-note", "core-posts-create-event", "core-posts-create-poll", "core-posts-create-article", "core-posts-read", "core-posts-delete", "core-posts-react", "core-posts-reply", "core-posts-rsvp", "core-posts-vote", "core-posts-create-*", "core-posts-*", "core-groups-*"];
17
+ /** Owner is omitted — `*` / `core-groups-*` already grants every editor cap. */
18
+ export declare const groupCapabilityEditorRelationships: readonly ["none", "local", "member", "moderator", "admin"];
19
+ /** Explicit admin list — `core-groups-*` would also grant delete and cap edits. */
20
+ export declare const defaultGroupAdminCapabilityAdds: readonly ["core-posts-*", "core-groups-read", "core-groups-update", "core-groups-join", "core-groups-leave", "core-groups-addMember", "core-groups-removeMember", "core-groups-changeMemberRole"];
21
+ export declare const defaultGroupOwnerCapabilityAdds: readonly ["core-posts-*", "core-groups-*"];
15
22
  export declare const profileCapabilities: readonly ["core-profiles-read", "core-profiles-update", "core-profiles-delete", "core-profiles-requestFollow", "core-profiles-follow", "core-profiles-unfollow", "core-profiles-block", "core-profiles-unblock", "core-profiles-mute", "core-profiles-unmute"];
16
23
  export declare const reportCapabilities: readonly ["core-reports-create", "core-reports-read"];
17
24
  export declare const accessTokenCapabilities: readonly ["core-serviceTokens-create", "core-serviceTokens-read", "core-serviceTokens-delete"];
@@ -20,5 +27,5 @@ export type GroupCapability = (typeof groupCapabilities)[number];
20
27
  export type ProfileCapability = (typeof profileCapabilities)[number];
21
28
  export type ReportCapability = (typeof reportCapabilities)[number];
22
29
  export type AccessTokenCapability = (typeof accessTokenCapabilities)[number];
23
- export declare const roleCapabilities: readonly ["core-local", "core-accounts-read", "core-accounts-create", "core-accounts-update", "core-accounts-delete", "core-reports-create", "core-reports-update", "core-groups-create", "core-groups-read", "core-groups-delete", "core-groups-addMember", "core-groups-removeMember", "core-groups-changeMemberRole", "core-posts-create-note-local", "core-posts-create-note-public", "core-posts-create-note-direct", "core-posts-create-note-private", "core-posts-create-event-local", "core-posts-create-event-public", "core-posts-create-event-direct", "core-posts-create-event-private", "core-posts-create-poll-local", "core-posts-create-poll-public", "core-posts-create-poll-direct", "core-posts-create-poll-private", "core-posts-create-article-local", "core-posts-create-article-public", "core-posts-create-article-direct", "core-posts-create-article-private", "core-posts-read-local", "core-posts-announce", "core-posts-delete", "core-profiles-read", "core-profiles-roles-update", "core-profiles-delete", "core-profiles-suspend", "core-profiles-update", "core-profiles-impersonate", "core-analytics-read", "core-config-update", "core-config-read", "core-customization-read", "core-customization-update", "core-capabilities-read", "core-capabilities-update", "core-backups-create", "core-backups-read", "core-backups-download", "core-backups-restore", "core-db-access", "core-i18n-update", "core-logs-read", "core-roles-read", "core-roles-update", "core-maintenance-restart", "core-inviteLinks-create", "core-inviteLinks-read", "core-inviteLinks-update", "core-inviteLinks-delete", "core-serviceTokens-create", "core-serviceTokens-read", "core-serviceTokens-update", "core-serviceTokens-delete"];
30
+ export declare const roleCapabilities: readonly ["core-local", "core-accounts-read", "core-accounts-create", "core-accounts-update", "core-accounts-delete", "core-reports-create", "core-reports-update", "core-groups-create", "core-groups-read", "core-groups-delete", "core-groups-addMember", "core-groups-removeMember", "core-groups-changeMemberRole", "core-posts-create-note-local", "core-posts-create-note-public", "core-posts-create-note-direct", "core-posts-create-note-private", "core-posts-create-event-local", "core-posts-create-event-public", "core-posts-create-event-direct", "core-posts-create-event-private", "core-posts-create-poll-local", "core-posts-create-poll-public", "core-posts-create-poll-direct", "core-posts-create-poll-private", "core-posts-create-article-local", "core-posts-create-article-public", "core-posts-create-article-direct", "core-posts-create-article-private", "core-posts-read-local", "core-posts-announce", "core-posts-delete", "core-profiles-read", "core-profiles-roles-update", "core-profiles-delete", "core-profiles-suspend", "core-profiles-update", "core-profiles-impersonate", "core-analytics-read", "core-config-update", "core-config-read", "core-customization-read", "core-customization-update", "core-capabilities-read", "core-capabilities-update", "core-backups-create", "core-backups-read", "core-backups-download", "core-backups-restore", "core-db-access", "core-i18n-update", "core-logs-read", "core-roles-read", "core-roles-update", "core-maintenance-restart", "core-inviteLinks-create", "core-inviteLinks-read", "core-inviteLinks-update", "core-inviteLinks-delete", "core-serviceTokens-create", "core-serviceTokens-read", "core-serviceTokens-update", "core-serviceTokens-delete", "core-plugins-manage"];
24
31
  export type RoleCapability = (typeof roleCapabilities)[number];
@@ -6,7 +6,12 @@ export const postRelationships = [
6
6
  'attendee',
7
7
  'collaborator',
8
8
  ];
9
- export const defaultGroupRoles = ['member', 'admin', 'moderator'];
9
+ export const defaultGroupRoles = [
10
+ 'member',
11
+ 'moderator',
12
+ 'admin',
13
+ 'owner',
14
+ ];
10
15
  export const groupRelationships = [
11
16
  ...defaultGroupRoles,
12
17
  'none',
@@ -45,6 +50,7 @@ export const postCapabilities = [
45
50
  export const groupCapabilities = [
46
51
  'core-groups-read',
47
52
  'core-groups-update',
53
+ 'core-groups-updateCapabilities',
48
54
  'core-groups-delete',
49
55
  'core-groups-join',
50
56
  'core-groups-leave',
@@ -56,6 +62,42 @@ export const groupCapabilities = [
56
62
  'core-posts-create-poll',
57
63
  'core-posts-create-article',
58
64
  ];
65
+ /** Caps an owner can toggle per relationship in the group editor. */
66
+ export const groupCapabilityEditorKeys = [
67
+ ...groupCapabilities,
68
+ 'core-posts-read',
69
+ 'core-posts-delete',
70
+ 'core-posts-react',
71
+ 'core-posts-reply',
72
+ 'core-posts-rsvp',
73
+ 'core-posts-vote',
74
+ 'core-posts-create-*',
75
+ 'core-posts-*',
76
+ 'core-groups-*',
77
+ ];
78
+ /** Owner is omitted — `*` / `core-groups-*` already grants every editor cap. */
79
+ export const groupCapabilityEditorRelationships = [
80
+ 'none',
81
+ 'local',
82
+ 'member',
83
+ 'moderator',
84
+ 'admin',
85
+ ];
86
+ /** Explicit admin list — `core-groups-*` would also grant delete and cap edits. */
87
+ export const defaultGroupAdminCapabilityAdds = [
88
+ 'core-posts-*',
89
+ 'core-groups-read',
90
+ 'core-groups-update',
91
+ 'core-groups-join',
92
+ 'core-groups-leave',
93
+ 'core-groups-addMember',
94
+ 'core-groups-removeMember',
95
+ 'core-groups-changeMemberRole',
96
+ ];
97
+ export const defaultGroupOwnerCapabilityAdds = [
98
+ 'core-posts-*',
99
+ 'core-groups-*',
100
+ ];
59
101
  export const profileCapabilities = [
60
102
  'core-profiles-read',
61
103
  'core-profiles-update',
@@ -141,4 +183,5 @@ export const roleCapabilities = [
141
183
  'core-serviceTokens-read',
142
184
  'core-serviceTokens-update',
143
185
  'core-serviceTokens-delete',
186
+ 'core-plugins-manage',
144
187
  ];
@@ -85,7 +85,7 @@ export declare const coreConfigSchemaFactory: (sanitize?: boolean) => z.ZodObjec
85
85
  maxProfiles: z.ZodOptional<z.ZodNumber>;
86
86
  }, z.core.$strip>;
87
87
  db: z.ZodObject<{
88
- url: z.ZodString;
88
+ url: z.ZodOptional<z.ZodString>;
89
89
  databaseName: z.ZodOptional<z.ZodString>;
90
90
  databaseUrl: z.ZodString;
91
91
  }, z.core.$strip>;
@@ -157,7 +157,11 @@ export declare const coreConfigSchemaFactory: (sanitize?: boolean) => z.ZodObjec
157
157
  }, z.core.$strip>;
158
158
  }, z.core.$strip>;
159
159
  sso: z.ZodObject<{
160
+ onlySSO: z.ZodOptional<z.ZodBoolean>;
160
161
  generic: z.ZodArray<z.ZodDefault<z.ZodObject<{
162
+ id: z.ZodDefault<z.ZodString>;
163
+ name: z.ZodDefault<z.ZodString>;
164
+ loginLink: z.ZodOptional<z.ZodString>;
161
165
  userProfileRequest: z.ZodObject<{
162
166
  url: z.ZodString;
163
167
  authHeader: z.ZodOptional<z.ZodString>;
@@ -241,7 +245,7 @@ export declare const coreConfigSchema: z.ZodObject<{
241
245
  maxProfiles: z.ZodOptional<z.ZodNumber>;
242
246
  }, z.core.$strip>;
243
247
  db: z.ZodObject<{
244
- url: z.ZodString;
248
+ url: z.ZodOptional<z.ZodString>;
245
249
  databaseName: z.ZodOptional<z.ZodString>;
246
250
  databaseUrl: z.ZodString;
247
251
  }, z.core.$strip>;
@@ -313,7 +317,11 @@ export declare const coreConfigSchema: z.ZodObject<{
313
317
  }, z.core.$strip>;
314
318
  }, z.core.$strip>;
315
319
  sso: z.ZodObject<{
320
+ onlySSO: z.ZodOptional<z.ZodBoolean>;
316
321
  generic: z.ZodArray<z.ZodDefault<z.ZodObject<{
322
+ id: z.ZodDefault<z.ZodString>;
323
+ name: z.ZodDefault<z.ZodString>;
324
+ loginLink: z.ZodOptional<z.ZodString>;
317
325
  userProfileRequest: z.ZodObject<{
318
326
  url: z.ZodString;
319
327
  authHeader: z.ZodOptional<z.ZodString>;
@@ -397,7 +405,7 @@ export declare const coreConfigSanitizedSchema: z.ZodObject<{
397
405
  maxProfiles: z.ZodOptional<z.ZodNumber>;
398
406
  }, z.core.$strip>;
399
407
  db: z.ZodObject<{
400
- url: z.ZodString;
408
+ url: z.ZodOptional<z.ZodString>;
401
409
  databaseName: z.ZodOptional<z.ZodString>;
402
410
  databaseUrl: z.ZodString;
403
411
  }, z.core.$strip>;
@@ -469,7 +477,11 @@ export declare const coreConfigSanitizedSchema: z.ZodObject<{
469
477
  }, z.core.$strip>;
470
478
  }, z.core.$strip>;
471
479
  sso: z.ZodObject<{
480
+ onlySSO: z.ZodOptional<z.ZodBoolean>;
472
481
  generic: z.ZodArray<z.ZodDefault<z.ZodObject<{
482
+ id: z.ZodDefault<z.ZodString>;
483
+ name: z.ZodDefault<z.ZodString>;
484
+ loginLink: z.ZodOptional<z.ZodString>;
473
485
  userProfileRequest: z.ZodObject<{
474
486
  url: z.ZodString;
475
487
  authHeader: z.ZodOptional<z.ZodString>;
@@ -557,13 +569,6 @@ export declare const communityConfigSchemaFactory: (_sanitize?: boolean) => z.Zo
557
569
  base: z.ZodString;
558
570
  icon: z.ZodOptional<z.ZodString>;
559
571
  mobileIcon: z.ZodOptional<z.ZodString>;
560
- primaryHex: z.ZodString;
561
- logoFull: z.ZodOptional<z.ZodString>;
562
- logoSmall: z.ZodOptional<z.ZodString>;
563
- defaultProfileAvatar: z.ZodOptional<z.ZodString>;
564
- defaultGroupAvatar: z.ZodOptional<z.ZodString>;
565
- backgroundAuth: z.ZodOptional<z.ZodString>;
566
- background: z.ZodOptional<z.ZodString>;
567
572
  light: z.ZodObject<{
568
573
  primaryHex: z.ZodString;
569
574
  secondaryHex: z.ZodOptional<z.ZodString>;
@@ -631,13 +636,6 @@ export declare const communityConfigSchema: z.ZodObject<{
631
636
  base: z.ZodString;
632
637
  icon: z.ZodOptional<z.ZodString>;
633
638
  mobileIcon: z.ZodOptional<z.ZodString>;
634
- primaryHex: z.ZodString;
635
- logoFull: z.ZodOptional<z.ZodString>;
636
- logoSmall: z.ZodOptional<z.ZodString>;
637
- defaultProfileAvatar: z.ZodOptional<z.ZodString>;
638
- defaultGroupAvatar: z.ZodOptional<z.ZodString>;
639
- backgroundAuth: z.ZodOptional<z.ZodString>;
640
- background: z.ZodOptional<z.ZodString>;
641
639
  light: z.ZodObject<{
642
640
  primaryHex: z.ZodString;
643
641
  secondaryHex: z.ZodOptional<z.ZodString>;
@@ -705,13 +703,6 @@ export declare const communityConfigSanitizedSchema: z.ZodObject<{
705
703
  base: z.ZodString;
706
704
  icon: z.ZodOptional<z.ZodString>;
707
705
  mobileIcon: z.ZodOptional<z.ZodString>;
708
- primaryHex: z.ZodString;
709
- logoFull: z.ZodOptional<z.ZodString>;
710
- logoSmall: z.ZodOptional<z.ZodString>;
711
- defaultProfileAvatar: z.ZodOptional<z.ZodString>;
712
- defaultGroupAvatar: z.ZodOptional<z.ZodString>;
713
- backgroundAuth: z.ZodOptional<z.ZodString>;
714
- background: z.ZodOptional<z.ZodString>;
715
706
  light: z.ZodObject<{
716
707
  primaryHex: z.ZodString;
717
708
  secondaryHex: z.ZodOptional<z.ZodString>;
@@ -59,7 +59,8 @@ export const coreConfigSchemaFactory = (sanitize) => z.object({
59
59
  maxProfiles: fixed(z.number().int().nonnegative().optional(), sanitize),
60
60
  }),
61
61
  db: fixed(z.object({
62
- url: z.string().url(),
62
+ // Optional leftovers so Arango-era stored configs still parse.
63
+ url: z.string().url().optional(),
63
64
  databaseName: z.string().optional(),
64
65
  databaseUrl: z.string(),
65
66
  }), sanitize),
@@ -112,8 +113,13 @@ export const coreConfigSchemaFactory = (sanitize) => z.object({
112
113
  }),
113
114
  }),
114
115
  sso: z.object({
116
+ onlySSO: z.boolean().optional(),
115
117
  generic: z
116
118
  .object({
119
+ id: z.string().default('example-generic'),
120
+ name: z.string().default('Generic SSO'),
121
+ /** URL or path shown on the login page to start this provider's flow. */
122
+ loginLink: z.string().optional(),
117
123
  userProfileRequest: z.object({
118
124
  url: z.string(),
119
125
  authHeader: z.string().optional(),
@@ -128,6 +134,9 @@ export const coreConfigSchemaFactory = (sanitize) => z.object({
128
134
  createProfiles: z.boolean().optional(),
129
135
  })
130
136
  .default({
137
+ id: 'example-generic',
138
+ name: 'Generic SSO',
139
+ loginLink: '',
131
140
  userProfileRequest: {
132
141
  url: 'https://example.com/profile',
133
142
  authHeader: 'Bearer ${token}',
@@ -225,13 +234,6 @@ export const communityConfigSchemaFactory = (_sanitize) => z.object({
225
234
  base: z.string(),
226
235
  icon: z.string().optional(),
227
236
  mobileIcon: z.string().optional(),
228
- primaryHex: z.string(),
229
- logoFull: z.string().optional(),
230
- logoSmall: z.string().optional(),
231
- defaultProfileAvatar: z.string().optional(),
232
- defaultGroupAvatar: z.string().optional(),
233
- backgroundAuth: z.string().optional(),
234
- background: z.string().optional(),
235
237
  light: z.object({
236
238
  primaryHex: z.string(),
237
239
  secondaryHex: z.string().optional(),