@openpeepshq/core 0.1.35 → 0.2.1

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 (92) hide show
  1. package/dist/accounts/mutations.js +9 -0
  2. package/dist/analytics/report.d.ts +1 -1
  3. package/dist/config/defaults/logs.d.ts +4 -0
  4. package/dist/config/defaults/logs.js +5 -0
  5. package/dist/config/index.d.ts +3 -328
  6. package/dist/db/explorer/index.d.ts +1 -1
  7. package/dist/db/explorer/index.js +1 -1
  8. package/dist/db/pg/filters/posts.js +1 -1
  9. package/dist/db/pg/map/registry.js +3 -2
  10. package/dist/groups/finders.d.ts +2 -2
  11. package/dist/groups/helpers.d.ts +6 -6
  12. package/dist/groups/mapping.d.ts +4 -4
  13. package/dist/jams/export.d.ts +2 -0
  14. package/dist/jams/export.js +5 -0
  15. package/dist/jams/finders.d.ts +1 -0
  16. package/dist/jams/finders.js +1 -0
  17. package/dist/jams/health.d.ts +23 -0
  18. package/dist/jams/health.js +79 -7
  19. package/dist/jams/helpers.d.ts +2 -2
  20. package/dist/jams/index.d.ts +1 -1
  21. package/dist/jams/index.js +10 -3
  22. package/dist/jams/livekit.d.ts +2 -2
  23. package/dist/jams/mapping.d.ts +10 -10
  24. package/dist/jams/mutations.d.ts +2 -2
  25. package/dist/jams/token.js +6 -2
  26. package/dist/jams/waitingRoom.js +3 -1
  27. package/dist/log/index.d.ts +1 -0
  28. package/dist/log/index.js +1 -0
  29. package/dist/log/retention.d.ts +9 -0
  30. package/dist/log/retention.js +83 -0
  31. package/dist/log/retentionJobs.d.ts +17 -0
  32. package/dist/log/retentionJobs.js +50 -0
  33. package/dist/media/garbageCollection.d.ts +109 -0
  34. package/dist/media/garbageCollection.js +603 -0
  35. package/dist/media/garbageCollectionJobs.d.ts +14 -0
  36. package/dist/media/garbageCollectionJobs.js +55 -0
  37. package/dist/media/index.d.ts +2 -0
  38. package/dist/media/index.js +91 -12
  39. package/dist/media/streaming.d.ts +2 -0
  40. package/dist/media/streaming.js +8 -0
  41. package/dist/mediaAttachments/mapping.d.ts +1 -1
  42. package/dist/notifications/defaultNotifications/index.js +2 -0
  43. package/dist/notifications/defaultNotifications/jamModerator/index.js +25 -16
  44. package/dist/notifications/defaultNotifications/jamModerator/recipients.d.ts +2 -0
  45. package/dist/notifications/defaultNotifications/jamModerator/recipients.js +5 -0
  46. package/dist/notifications/defaultNotifications/jamStarted/index.d.ts +1 -0
  47. package/dist/notifications/defaultNotifications/jamStarted/index.js +61 -13
  48. package/dist/notifications/defaultNotifications/newGroupPost/index.js +3 -3
  49. package/dist/notifications/defaultNotifications/newGroupPost/recipients.d.ts +5 -0
  50. package/dist/notifications/defaultNotifications/newGroupPost/recipients.js +23 -0
  51. package/dist/notifications/defaultNotifications/waitlistOffer/index.d.ts +24 -0
  52. package/dist/notifications/defaultNotifications/waitlistOffer/index.js +40 -0
  53. package/dist/notifications/eventIcsAttachment.d.ts +6 -0
  54. package/dist/notifications/eventIcsAttachment.js +32 -0
  55. package/dist/notifications/helpers.d.ts +11 -1
  56. package/dist/notifications/helpers.js +26 -0
  57. package/dist/notifications/index.d.ts +1 -1
  58. package/dist/notifications/index.js +1 -1
  59. package/dist/notifications/jobs.js +6 -0
  60. package/dist/notifications/mutations.js +9 -1
  61. package/dist/plugins/pluginAuth.js +1 -0
  62. package/dist/posts/activity.d.ts +1 -1
  63. package/dist/posts/activity.js +1 -1
  64. package/dist/posts/conversationQueries.d.ts +31 -0
  65. package/dist/posts/conversationQueries.js +150 -24
  66. package/dist/posts/eventAgenda.js +4 -2
  67. package/dist/posts/finders.d.ts +15 -6
  68. package/dist/posts/finders.js +23 -3
  69. package/dist/posts/helpers/index.d.ts +34 -26
  70. package/dist/posts/helpers/index.js +6 -0
  71. package/dist/posts/index.d.ts +3 -1
  72. package/dist/posts/index.js +3 -1
  73. package/dist/posts/mapping.d.ts +112 -98
  74. package/dist/posts/mutations.d.ts +24 -18
  75. package/dist/posts/mutations.js +222 -72
  76. package/dist/posts/rsvpExport.d.ts +47 -0
  77. package/dist/posts/rsvpExport.js +178 -0
  78. package/dist/posts/unseenCounts.d.ts +6 -0
  79. package/dist/posts/unseenCounts.js +51 -1
  80. package/dist/posts/waitlist.d.ts +13 -0
  81. package/dist/posts/waitlist.js +75 -0
  82. package/dist/posts/waitlistOfferJobs.d.ts +10 -0
  83. package/dist/posts/waitlistOfferJobs.js +91 -0
  84. package/dist/profileSettings/mapping.d.ts +1 -0
  85. package/dist/profiles/index.js +6 -1
  86. package/dist/profiles/mapping.d.ts +10 -10
  87. package/dist/reports/mapping.d.ts +1 -1
  88. package/dist/server/index.d.ts +1 -0
  89. package/dist/stats/mapping.d.ts +7 -6
  90. package/dist/stripe/connection.js +1 -1
  91. package/dist/stripe/helpers.js +7 -3
  92. package/package.json +11 -10
@@ -140,6 +140,15 @@ export const updateAccount = async (accountData) => {
140
140
  }
141
141
  const previousEmail = accountData.account.email;
142
142
  const updatedEmail = normalizeEmailAddress(accountData.email);
143
+ if (updatedEmail && updatedEmail !== previousEmail) {
144
+ const existing = await findAccountByEmail(updatedEmail);
145
+ if (existing && existing.id !== accountData.account.id) {
146
+ throw conflict({
147
+ errorKey: 'emailAlreadyTaken',
148
+ parameters: { email: updatedEmail },
149
+ });
150
+ }
151
+ }
143
152
  const account = await accountsMapping.update(db, accountData.account.id, {
144
153
  email: updatedEmail,
145
154
  passwordHash: accountData.password
@@ -95,7 +95,7 @@ export declare const buildAnalyticsBoardReport: (query?: AnalyticsDateQuery) =>
95
95
  resource: number;
96
96
  }[];
97
97
  postTypes: {
98
- type: "resource" | "poll" | "note" | "event" | "article" | "jam";
98
+ type: "resource" | "note" | "event" | "article" | "poll" | "jam";
99
99
  count: number;
100
100
  }[];
101
101
  activeUsersSeries: {
@@ -2,5 +2,9 @@ declare const _default: {
2
2
  local: {
3
3
  path: string;
4
4
  };
5
+ retention: {
6
+ zipAfterDays: number;
7
+ deleteAfterDays: number;
8
+ };
5
9
  };
6
10
  export default _default;
@@ -1,7 +1,12 @@
1
1
  import dotenv from 'dotenv';
2
+ import { readEnvInteger } from '../helpers.js';
2
3
  dotenv.config();
3
4
  export default {
4
5
  local: {
5
6
  path: process.env.LOGS_LOCAL_PATH || './.logs',
6
7
  },
8
+ retention: {
9
+ zipAfterDays: readEnvInteger('LOGS_RETENTION_ZIP_AFTER_DAYS', 7),
10
+ deleteAfterDays: readEnvInteger('LOGS_RETENTION_DELETE_AFTER_DAYS', 30),
11
+ },
7
12
  };
@@ -14,170 +14,7 @@ export declare const refreshConfig: (namespace?: string, name?: string) => void;
14
14
  * admin UI forms and pin/unpin all send partial trees.
15
15
  */
16
16
  export declare const updateConfigValues: (configValues: unknown, namespace?: string, name?: string) => Promise<void>;
17
- export declare const config: <T = {
18
- version: string;
19
- environment: string;
20
- server: {
21
- host: string;
22
- signUpsOpen: boolean;
23
- publicContent: boolean;
24
- maxProfiles?: number | undefined;
25
- };
26
- db: {
27
- databaseUrl: string;
28
- url?: string | undefined;
29
- databaseName?: string | undefined;
30
- };
31
- redis: {
32
- host: string;
33
- };
34
- email: {
35
- service: string;
36
- defaultTemplatePath: string;
37
- transportConfig: {
38
- host: string;
39
- port: number;
40
- secure: boolean;
41
- auth?: {
42
- user?: string | undefined;
43
- pass?: string | undefined;
44
- } | undefined;
45
- };
46
- defaultFrom?: string | undefined;
47
- };
48
- logs: {
49
- local: {
50
- path: string;
51
- };
52
- };
53
- media: {
54
- maxUploadMb: number;
55
- storage: {
56
- driver: "openpeeps";
57
- params: {
58
- path: string;
59
- prefix: string;
60
- host?: string | undefined;
61
- };
62
- };
63
- };
64
- network: {
65
- port: number;
66
- };
67
- plugins: {
68
- path: string;
69
- rootPackageJsonPath: string;
70
- };
71
- secrets: {
72
- jwt: string;
73
- };
74
- jams: {
75
- livekit: {
76
- url: string;
77
- apiKey?: string | undefined;
78
- apiSecret?: string | undefined;
79
- recordingEnabled?: boolean | undefined;
80
- };
81
- };
82
- vapid: {
83
- privateKey?: string | undefined;
84
- publicKey?: string | undefined;
85
- };
86
- federation: {
87
- active: boolean;
88
- allowedHosts: string[];
89
- };
90
- activityPub: {
91
- defaultDomain: string;
92
- itemsPerPage: number;
93
- threadDepth: number;
94
- federation: {
95
- requestTimeout: number;
96
- };
97
- };
98
- sso: {
99
- generic: {
100
- id: string;
101
- name: string;
102
- userProfileRequest: {
103
- url: string;
104
- authHeader?: string | undefined;
105
- };
106
- userProfilePaths: {
107
- email: string;
108
- handle?: string | undefined;
109
- avatar?: string | undefined;
110
- displayName?: string | undefined;
111
- };
112
- loginLink?: string | undefined;
113
- createAccounts?: boolean | undefined;
114
- createProfiles?: boolean | undefined;
115
- }[];
116
- oidc: {
117
- id: string;
118
- name: string;
119
- authorizationUrl: string;
120
- tokenUrl: string;
121
- userinfoUrl: string;
122
- clientId: string;
123
- kind?: "oidc" | "github" | "gitlab" | "gitlab-selfhosted" | "google" | "entra" | "auth0" | "keycloak" | "authentik" | "okta" | "discord" | "pocketid" | undefined;
124
- instanceUrl?: string | undefined;
125
- tenant?: string | undefined;
126
- emailsUrl?: string | undefined;
127
- jwksUri?: string | undefined;
128
- clientSecret?: string | undefined;
129
- scope?: string | undefined;
130
- claimMapping?: {
131
- email?: string | undefined;
132
- handle?: string | undefined;
133
- displayName?: string | undefined;
134
- avatar?: string | undefined;
135
- } | undefined;
136
- approvalRequired?: boolean | undefined;
137
- }[];
138
- onlySSO?: boolean | undefined;
139
- };
140
- services: {
141
- sentry: {
142
- enabled: boolean;
143
- dsn?: string | undefined;
144
- replayEnabled?: boolean | undefined;
145
- };
146
- location: {
147
- type: string;
148
- url: string;
149
- apiKey?: string | undefined;
150
- };
151
- };
152
- apps: {
153
- ios: {
154
- url?: string | undefined;
155
- bundleIdentifier?: string | undefined;
156
- teamId?: string | undefined;
157
- appId?: string | undefined;
158
- apnKeyId?: string | undefined;
159
- apnSigningKey?: string | undefined;
160
- };
161
- android: {
162
- url?: string | undefined;
163
- packageName?: string | undefined;
164
- appId?: string | undefined;
165
- fcmCredentials?: string | undefined;
166
- };
167
- };
168
- payments: {
169
- stripe: {
170
- paidMembership?: {
171
- enabled: boolean;
172
- productId?: string | undefined;
173
- trialPeriodDays?: number | undefined;
174
- } | undefined;
175
- publishableKey?: string | undefined;
176
- secretKey?: string | undefined;
177
- webhookSecret?: string | undefined;
178
- };
179
- };
180
- }>(namespace?: string, name?: string) => Promise<T>;
17
+ export declare const config: <T = CoreConfig>(namespace?: string, name?: string) => Promise<T>;
181
18
  export declare const communityConfig: () => Promise<{
182
19
  theme: {
183
20
  base: string;
@@ -235,6 +72,7 @@ export declare const communityConfig: () => Promise<{
235
72
  defaultTimeZone?: string | undefined;
236
73
  defaultFeedFormat?: "threaded" | "linear" | undefined;
237
74
  indexProfiles?: boolean | undefined;
75
+ additionalForbiddenHandles?: string[] | undefined;
238
76
  };
239
77
  roles: {
240
78
  onRegistration: {
@@ -256,170 +94,7 @@ export declare const communityConfig: () => Promise<{
256
94
  } | undefined;
257
95
  }>;
258
96
  export declare const capabilitiesConfig: () => Promise<CapabilitiesConfig>;
259
- export declare const sanitizedConfigWithDefaults: <T = {
260
- version: string;
261
- environment: string;
262
- server: {
263
- host: string;
264
- signUpsOpen: boolean;
265
- publicContent: boolean;
266
- maxProfiles?: number | undefined;
267
- };
268
- db: {
269
- databaseUrl: string;
270
- url?: string | undefined;
271
- databaseName?: string | undefined;
272
- };
273
- redis: {
274
- host: string;
275
- };
276
- email: {
277
- service: string;
278
- defaultTemplatePath: string;
279
- transportConfig: {
280
- host: string;
281
- port: number;
282
- secure: boolean;
283
- auth?: {
284
- user?: string | undefined;
285
- pass?: string | undefined;
286
- } | undefined;
287
- };
288
- defaultFrom?: string | undefined;
289
- };
290
- logs: {
291
- local: {
292
- path: string;
293
- };
294
- };
295
- media: {
296
- maxUploadMb: number;
297
- storage: {
298
- driver: "openpeeps";
299
- params: {
300
- path: string;
301
- prefix: string;
302
- host?: string | undefined;
303
- };
304
- };
305
- };
306
- network: {
307
- port: number;
308
- };
309
- plugins: {
310
- path: string;
311
- rootPackageJsonPath: string;
312
- };
313
- secrets: {
314
- jwt: string;
315
- };
316
- jams: {
317
- livekit: {
318
- url: string;
319
- apiKey?: string | undefined;
320
- apiSecret?: string | undefined;
321
- recordingEnabled?: boolean | undefined;
322
- };
323
- };
324
- vapid: {
325
- privateKey?: string | undefined;
326
- publicKey?: string | undefined;
327
- };
328
- federation: {
329
- active: boolean;
330
- allowedHosts: string[];
331
- };
332
- activityPub: {
333
- defaultDomain: string;
334
- itemsPerPage: number;
335
- threadDepth: number;
336
- federation: {
337
- requestTimeout: number;
338
- };
339
- };
340
- sso: {
341
- generic: {
342
- id: string;
343
- name: string;
344
- userProfileRequest: {
345
- url: string;
346
- authHeader?: string | undefined;
347
- };
348
- userProfilePaths: {
349
- email: string;
350
- handle?: string | undefined;
351
- avatar?: string | undefined;
352
- displayName?: string | undefined;
353
- };
354
- loginLink?: string | undefined;
355
- createAccounts?: boolean | undefined;
356
- createProfiles?: boolean | undefined;
357
- }[];
358
- oidc: {
359
- id: string;
360
- name: string;
361
- authorizationUrl: string;
362
- tokenUrl: string;
363
- userinfoUrl: string;
364
- clientId: string;
365
- kind?: "oidc" | "github" | "gitlab" | "gitlab-selfhosted" | "google" | "entra" | "auth0" | "keycloak" | "authentik" | "okta" | "discord" | "pocketid" | undefined;
366
- instanceUrl?: string | undefined;
367
- tenant?: string | undefined;
368
- emailsUrl?: string | undefined;
369
- jwksUri?: string | undefined;
370
- clientSecret?: string | undefined;
371
- scope?: string | undefined;
372
- claimMapping?: {
373
- email?: string | undefined;
374
- handle?: string | undefined;
375
- displayName?: string | undefined;
376
- avatar?: string | undefined;
377
- } | undefined;
378
- approvalRequired?: boolean | undefined;
379
- }[];
380
- onlySSO?: boolean | undefined;
381
- };
382
- services: {
383
- sentry: {
384
- enabled: boolean;
385
- dsn?: string | undefined;
386
- replayEnabled?: boolean | undefined;
387
- };
388
- location: {
389
- type: string;
390
- url: string;
391
- apiKey?: string | undefined;
392
- };
393
- };
394
- apps: {
395
- ios: {
396
- url?: string | undefined;
397
- bundleIdentifier?: string | undefined;
398
- teamId?: string | undefined;
399
- appId?: string | undefined;
400
- apnKeyId?: string | undefined;
401
- apnSigningKey?: string | undefined;
402
- };
403
- android: {
404
- url?: string | undefined;
405
- packageName?: string | undefined;
406
- appId?: string | undefined;
407
- fcmCredentials?: string | undefined;
408
- };
409
- };
410
- payments: {
411
- stripe: {
412
- paidMembership?: {
413
- enabled: boolean;
414
- productId?: string | undefined;
415
- trialPeriodDays?: number | undefined;
416
- } | undefined;
417
- publishableKey?: string | undefined;
418
- secretKey?: string | undefined;
419
- webhookSecret?: string | undefined;
420
- };
421
- };
422
- }>(namespace?: string, name?: string) => Promise<{
97
+ export declare const sanitizedConfigWithDefaults: <T = CoreConfig>(namespace?: string, name?: string) => Promise<{
423
98
  config: unknown;
424
99
  defaults: unknown;
425
100
  }>;
@@ -2,5 +2,5 @@ export { listExplorerTables, getExplorerTable, describeExplorerTable, quoteIdent
2
2
  export { listExplorerRows, DEFAULT_ROW_LIMIT, MAX_ROW_LIMIT, MAX_EXPORT_LIMIT, clampLimit, buildFilterClause, } from './query';
3
3
  export type { ListRowsInput } from './query';
4
4
  export { updateExplorerRow } from './mutate';
5
- export { runExplorerSql, SQL_STATEMENT_TIMEOUT_MS, SQL_MAX_ROWS, SQL_HARD_MAX_ROWS, SQL_DEFAULT_MAX_ROWS } from './sql';
5
+ export { runExplorerSql, SQL_STATEMENT_TIMEOUT_MS, SQL_MAX_ROWS, SQL_HARD_MAX_ROWS, SQL_DEFAULT_MAX_ROWS, } from './sql';
6
6
  export { rowsToCsv } from './csv';
@@ -1,5 +1,5 @@
1
1
  export { listExplorerTables, getExplorerTable, describeExplorerTable, quoteIdent, assertKnownColumns, primaryKeyColumns, } from './tables.js';
2
2
  export { listExplorerRows, DEFAULT_ROW_LIMIT, MAX_ROW_LIMIT, MAX_EXPORT_LIMIT, clampLimit, buildFilterClause, } from './query.js';
3
3
  export { updateExplorerRow } from './mutate.js';
4
- export { runExplorerSql, SQL_STATEMENT_TIMEOUT_MS, SQL_MAX_ROWS, SQL_HARD_MAX_ROWS, SQL_DEFAULT_MAX_ROWS } from './sql.js';
4
+ export { runExplorerSql, SQL_STATEMENT_TIMEOUT_MS, SQL_MAX_ROWS, SQL_HARD_MAX_ROWS, SQL_DEFAULT_MAX_ROWS, } from './sql.js';
5
5
  export { rowsToCsv } from './csv.js';
@@ -55,7 +55,7 @@ export const postFilters = {
55
55
  : undefined,
56
56
  };
57
57
  export const eventTimeFilters = {
58
- upcoming: (now = new Date().toISOString()) => pgSql(or(sql `${eventStart} > ${now}`, and(sql `${posts.body}->'end' IS NOT NULL`, sql `${eventEnd} > ${now}`))),
58
+ upcoming: (now = new Date().toISOString()) => pgSql(sql `${eventEffectiveEnd} >= ${now}::timestamptz`),
59
59
  current: (now = new Date().toISOString()) => pgSql(and(sql `${eventStart}::timestamptz <= ${now}::timestamptz`, sql `${eventEffectiveEnd} >= ${now}::timestamptz`)),
60
60
  past: (now = new Date().toISOString()) => pgSql(sql `${eventEffectiveEnd} < ${now}::timestamptz`),
61
61
  };
@@ -1,3 +1,4 @@
1
+ import { withDeletedProfileIdentity } from '@openpeepshq/common/lib';
1
2
  import * as documents from '../schema/documents.js';
2
3
  import * as edges from '../schema/edges.js';
3
4
  import { modelTimestampsFromRow, normalizeIsoDatetime, rowToModel, } from '../mappers.js';
@@ -402,7 +403,7 @@ export const rowToDocument = (collection, row, keepMetadata = false) => {
402
403
  guest: row.guest ?? undefined,
403
404
  }, timestamps);
404
405
  case 'profiles':
405
- return rowToModel(row.id, {
406
+ return withDeletedProfileIdentity(rowToModel(row.id, {
406
407
  handle: row.handle,
407
408
  type: row.type,
408
409
  ...(row.activityPubDomain
@@ -424,7 +425,7 @@ export const rowToDocument = (collection, row, keepMetadata = false) => {
424
425
  ...(typeof row.fetchedAt === 'string'
425
426
  ? { fetchedAt: normalizeIsoDatetime(row.fetchedAt) }
426
427
  : {}),
427
- }, timestamps);
428
+ }, timestamps));
428
429
  case 'posts': {
429
430
  const lastActivityAt = row.lastActivityAt
430
431
  ? normalizeIsoDatetime(row.lastActivityAt)
@@ -74,7 +74,7 @@ export declare const listAdminGroups: () => Promise<{
74
74
  postsCount: number;
75
75
  owners: {
76
76
  handle: string;
77
- type: "guest" | "local" | "federated";
77
+ type: "local" | "guest" | "federated";
78
78
  id: string;
79
79
  createdAt: string;
80
80
  updatedAt: string;
@@ -107,7 +107,7 @@ export declare const listAdminGroups: () => Promise<{
107
107
  guestData?: {
108
108
  email?: string | undefined;
109
109
  resource?: {
110
- type: "profiles" | "groups" | "posts" | "notifications" | "reports" | "db" | "self" | "*" | "jams" | "webhooks" | "analytics" | "render";
110
+ type: "db" | "jams" | "profiles" | "self" | "*" | "notifications" | "posts" | "groups" | "reports" | "webhooks" | "analytics" | "render";
111
111
  id?: string | undefined;
112
112
  } | undefined;
113
113
  } | undefined;
@@ -2,7 +2,7 @@ import type { GroupWithMeta, ProfileWithMeta } from '@openpeepshq/common/types';
2
2
  import type { PgFilter } from '../db/pg/map/queryTypes';
3
3
  export declare const addMember: (db: import("../db").PgDb, from: {
4
4
  id: string;
5
- type: "guest" | "local" | "federated";
5
+ type: "local" | "guest" | "federated";
6
6
  createdAt: string;
7
7
  updatedAt: string;
8
8
  handle: string;
@@ -77,18 +77,18 @@ export declare const addMember: (db: import("../db").PgDb, from: {
77
77
  lastPostAt?: string | null | undefined;
78
78
  deletedAt?: string | null | undefined;
79
79
  }, data?: {
80
- roles?: ("local" | "none" | "member" | "moderator" | "admin" | "owner" | "invited")[] | null | undefined;
80
+ roles?: ("local" | "member" | "none" | "owner" | "moderator" | "admin" | "invited")[] | null | undefined;
81
81
  } & {
82
82
  id?: string;
83
83
  }) => Promise<import("../db/pg/map").WithId<{
84
- roles?: ("local" | "none" | "member" | "moderator" | "admin" | "owner" | "invited")[] | null | undefined;
84
+ roles?: ("local" | "member" | "none" | "owner" | "moderator" | "admin" | "invited")[] | null | undefined;
85
85
  } & {
86
86
  _from: string;
87
87
  _to: string;
88
88
  }>>;
89
89
  export declare const removeMember: (db: import("../db").PgDb, from: {
90
90
  id: string;
91
- type: "guest" | "local" | "federated";
91
+ type: "local" | "guest" | "federated";
92
92
  createdAt: string;
93
93
  updatedAt: string;
94
94
  handle: string;
@@ -165,7 +165,7 @@ export declare const removeMember: (db: import("../db").PgDb, from: {
165
165
  }) => Promise<void>;
166
166
  export declare const updateMember: (db: import("../db").PgDb, from: {
167
167
  id: string;
168
- type: "guest" | "local" | "federated";
168
+ type: "local" | "guest" | "federated";
169
169
  createdAt: string;
170
170
  updatedAt: string;
171
171
  handle: string;
@@ -240,6 +240,6 @@ export declare const updateMember: (db: import("../db").PgDb, from: {
240
240
  lastPostAt?: string | null | undefined;
241
241
  deletedAt?: string | null | undefined;
242
242
  }, data?: {
243
- roles?: ("local" | "none" | "member" | "moderator" | "admin" | "owner" | "invited")[] | null | undefined;
243
+ roles?: ("local" | "member" | "none" | "owner" | "moderator" | "admin" | "invited")[] | null | undefined;
244
244
  } | undefined) => Promise<void>;
245
245
  export declare const canSeeGroupFilter: (profile?: ProfileWithMeta) => PgFilter<GroupWithMeta> | undefined;
@@ -76,7 +76,7 @@ export declare const adminGroupsMapping: import("../db/pg/map").Mapping<{
76
76
  postsCount: number;
77
77
  owners: {
78
78
  handle: string;
79
- type: "guest" | "local" | "federated";
79
+ type: "local" | "guest" | "federated";
80
80
  id: string;
81
81
  createdAt: string;
82
82
  updatedAt: string;
@@ -109,7 +109,7 @@ export declare const adminGroupsMapping: import("../db/pg/map").Mapping<{
109
109
  guestData?: {
110
110
  email?: string | undefined;
111
111
  resource?: {
112
- type: "profiles" | "groups" | "posts" | "notifications" | "reports" | "db" | "self" | "*" | "jams" | "webhooks" | "analytics" | "render";
112
+ type: "db" | "jams" | "profiles" | "self" | "*" | "notifications" | "posts" | "groups" | "reports" | "webhooks" | "analytics" | "render";
113
113
  id?: string | undefined;
114
114
  } | undefined;
115
115
  } | undefined;
@@ -138,7 +138,7 @@ export declare const adminGroupsMapping: import("../db/pg/map").Mapping<{
138
138
  postsCount: number;
139
139
  owners: {
140
140
  handle: string;
141
- type: "guest" | "local" | "federated";
141
+ type: "local" | "guest" | "federated";
142
142
  id: string;
143
143
  createdAt: string;
144
144
  updatedAt: string;
@@ -171,7 +171,7 @@ export declare const adminGroupsMapping: import("../db/pg/map").Mapping<{
171
171
  guestData?: {
172
172
  email?: string | undefined;
173
173
  resource?: {
174
- type: "profiles" | "groups" | "posts" | "notifications" | "reports" | "db" | "self" | "*" | "jams" | "webhooks" | "analytics" | "render";
174
+ type: "db" | "jams" | "profiles" | "self" | "*" | "notifications" | "posts" | "groups" | "reports" | "webhooks" | "analytics" | "render";
175
175
  id?: string | undefined;
176
176
  } | undefined;
177
177
  } | undefined;
@@ -15,5 +15,7 @@ type AttendanceProfile = Pick<Profile, 'type' | 'displayName' | 'handle' | 'gues
15
15
  export declare const jamAttendanceExportHeaders: readonly ["Type", "Name", "Email", "Handle", "Joined At"];
16
16
  export declare const jamAttendanceRowFromJoin: (join: JoinRecord, profile: AttendanceProfile | undefined) => JamAttendanceExportRow;
17
17
  export declare const jamAttendanceExportCsv: (rows: JamAttendanceExportRow[]) => string;
18
+ /** Profiles that joined the jam room. Recurring jams share one room. */
19
+ export declare const listJamAttendeeProfileIds: (jamId: string) => Promise<string[]>;
18
20
  export declare const exportJamAttendanceCsv: (jamId: string) => Promise<string>;
19
21
  export {};
@@ -49,6 +49,11 @@ const listJamJoinEvents = async (jamId) => {
49
49
  ];
50
50
  });
51
51
  };
52
+ /** Profiles that joined the jam room. Recurring jams share one room. */
53
+ export const listJamAttendeeProfileIds = async (jamId) => {
54
+ const joins = await listJamJoinEvents(jamId);
55
+ return [...new Set(joins.map((join) => join.profileId))];
56
+ };
52
57
  export const exportJamAttendanceCsv = async (jamId) => {
53
58
  const joins = await listJamJoinEvents(jamId);
54
59
  const profileIds = [...new Set(joins.map((join) => join.profileId))];
@@ -10,6 +10,7 @@ export declare const listJamEvents: (jamId: string, { start, limit }?: {
10
10
  start?: string;
11
11
  limit?: number;
12
12
  }) => Promise<import("../db/pg/map").WithId<JamEvent>[]>;
13
+ export declare const listJamStarts: (jamId: string) => Promise<import("../db/pg/map").WithId<JamEvent>[]>;
13
14
  export declare const listAttendance: (jamId: string, { start, limit }?: {
14
15
  start?: string;
15
16
  limit?: number;
@@ -7,6 +7,7 @@ import { getJamState } from './cache.js';
7
7
  import { transformJamRecordingData } from './helpers.js';
8
8
  export const baseListJam = (props, { start, limit = 100 }) => addStartLimit(jamEventsMapping.filter({ matches: props }), start, limit);
9
9
  export const listJamEvents = (jamId, { start, limit } = {}) => allpeepDb().then(({ db }) => baseListJam({ jamId }, { start, limit }).all(db));
10
+ export const listJamStarts = (jamId) => allpeepDb().then(({ db }) => baseListJam({ jamId, type: 'start' }, { limit: 200 }).all(db));
10
11
  export const listAttendance = (jamId, { start, limit } = {}) => allpeepDb().then(({ db }) => baseListJam({ jamId, type: 'join' }, { start, limit }).all(db));
11
12
  export const findJamState = async (jam, hideParticipants, recurrenceId) => {
12
13
  const state = await getJamState(jam, recurrenceId);
@@ -1,10 +1,33 @@
1
+ import { type LivekitDiagnosis } from '@openpeepshq/common/types';
1
2
  export declare const LIVEKIT_HEALTH_TIMEOUT_MS = 5000;
2
3
  export declare const LIVEKIT_HEALTH_MAX_ATTEMPTS = 3;
4
+ /** Drop credential material if a client library echoes it in an error. */
5
+ export declare const redactSecrets: (message: string, secrets: Array<string | undefined>) => string;
6
+ export type LivekitProbeResult = {
7
+ ok: boolean;
8
+ error?: string;
9
+ };
3
10
  /**
4
11
  * True when a LiveKit RoomService call succeeds within maxAttempts. Retries so a
5
12
  * single transient failure does not disable jams for a full /server/info bucket.
6
13
  * Credentials in config are not enough — invalid keys fail on first RPC.
7
14
  */
15
+ export declare const probeLivekitConnectionResult: (listRooms: () => Promise<unknown>, timeoutMs?: number, maxAttempts?: number) => Promise<LivekitProbeResult>;
8
16
  export declare const probeLivekitConnection: (listRooms: () => Promise<unknown>, timeoutMs?: number, maxAttempts?: number) => Promise<boolean>;
9
17
  /** Cached LiveKit reachability. False when unset, unauthorized, or unreachable. */
10
18
  export declare const isLivekitConnected: () => Promise<boolean>;
19
+ export type LivekitDiagnosisInput = {
20
+ url?: string;
21
+ hasApiKey: boolean;
22
+ hasApiSecret: boolean;
23
+ recordingEnabled: boolean;
24
+ reachable: boolean;
25
+ error?: string;
26
+ };
27
+ /** Checklist the admin diagnosis page renders. Secrets never leave this shape. */
28
+ export declare const buildLivekitDiagnosis: (input: LivekitDiagnosisInput) => LivekitDiagnosis;
29
+ /**
30
+ * Fresh LiveKit check for admins. Bypasses the short health cache so Refresh
31
+ * reports the current credentials and the last probe error.
32
+ */
33
+ export declare const diagnoseLivekit: () => Promise<LivekitDiagnosis>;