@openpeepshq/core 0.1.31 → 0.1.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accessTokens/helpers.d.ts +2 -2
- package/dist/accessTokens/tokens.js +14 -7
- package/dist/accounts/mutations.d.ts +2 -2
- package/dist/analytics/cache.js +12 -7
- package/dist/analytics/clicks.d.ts +20 -0
- package/dist/analytics/clicks.js +194 -0
- package/dist/analytics/index.d.ts +1 -0
- package/dist/analytics/index.js +1 -0
- package/dist/analytics/metrics.d.ts +1 -0
- package/dist/analytics/metrics.js +5 -0
- package/dist/analytics/pdfReport.d.ts +1 -0
- package/dist/analytics/pdfReport.js +7 -5
- package/dist/analytics/privacy.d.ts +18 -0
- package/dist/analytics/privacy.js +10 -0
- package/dist/analytics/read.js +74 -16
- package/dist/analytics/report.d.ts +32 -1
- package/dist/analytics/report.js +9 -2
- package/dist/backups/index.js +13 -5
- package/dist/backups/metadata.d.ts +7 -0
- package/dist/config/defaults/community.js +0 -6
- package/dist/config/defaults/core.js +1 -0
- package/dist/config/defaults/db.d.ts +0 -2
- package/dist/config/defaults/db.js +0 -2
- package/dist/config/index.d.ts +20 -9
- package/dist/db/helpers.d.ts +6 -28
- package/dist/db/helpers.js +19 -149
- package/dist/db/index.d.ts +2 -0
- package/dist/db/index.js +4 -0
- package/dist/db/init.js +3 -2
- package/dist/db/migration/detect.d.ts +0 -3
- package/dist/db/migration/detect.js +0 -54
- package/dist/db/migration/importCollections.d.ts +1 -1
- package/dist/db/migration/importCollections.js +22 -6
- package/dist/db/migration/shared.d.ts +0 -4
- package/dist/db/migration/shared.js +0 -7
- package/dist/db/migration/transform.d.ts +2 -0
- package/dist/db/migration/transform.js +23 -0
- package/dist/db/pg/client.js +4 -0
- package/dist/db/pg/filters/edges.d.ts +1 -1
- package/dist/db/pg/filters/edges.js +1 -1
- package/dist/db/pg/filters/posts.d.ts +1 -0
- package/dist/db/pg/filters/posts.js +11 -1
- package/dist/db/pg/map/filters.js +5 -0
- package/dist/db/pg/map/relations.d.ts +1 -1
- package/dist/db/pg/map/relations.js +89 -41
- package/dist/db/pg/migrate.d.ts +23 -0
- package/dist/db/pg/migrate.js +87 -1
- package/dist/db/pg/queries/derived.d.ts +5 -0
- package/dist/db/pg/queries/derived.js +21 -0
- package/dist/db/pg/schema/analytics.d.ts +76 -0
- package/dist/db/pg/schema/analytics.js +11 -1
- package/dist/db/pg/schema/documents.d.ts +143 -0
- package/dist/db/pg/schema/documents.js +22 -1
- package/dist/db/pg/schema/edges.d.ts +1 -0
- package/dist/db/pg/schema/edges.js +1 -0
- package/dist/db/pg/schema/index.d.ts +218 -0
- package/dist/db/pg/sql/0005_open_power_man.sql +9 -0
- package/dist/db/pg/sql/0006_fine_trish_tilby.sql +8 -0
- package/dist/db/pg/sql/0007_shallow_oracle.sql +3 -0
- package/dist/db/pg/sql/0008_group_owner_roles.sql +31 -0
- package/dist/db/pg/sql/0009_event_occurrences.sql +26 -0
- package/dist/db/pg/sql/meta/0004_snapshot.json +1 -1
- package/dist/db/pg/sql/meta/0005_snapshot.json +4179 -0
- package/dist/db/pg/sql/meta/0006_snapshot.json +4200 -0
- package/dist/db/pg/sql/meta/0007_snapshot.json +4179 -0
- package/dist/db/pg/sql/meta/0009_snapshot.json +4299 -0
- package/dist/db/pg/sql/meta/_journal.json +35 -0
- package/dist/db/replaceOrigin.d.ts +11 -0
- package/dist/db/replaceOrigin.js +116 -0
- package/dist/db/types.d.ts +0 -4
- package/dist/events/index.d.ts +2 -1
- package/dist/events/index.js +54 -33
- package/dist/groups/finders.d.ts +2 -2
- package/dist/groups/helpers.d.ts +6 -6
- package/dist/groups/mapping.d.ts +4 -4
- package/dist/groups/mapping.js +2 -2
- package/dist/groups/mutations.js +1 -1
- package/dist/inviteLinks/helpers.d.ts +4 -4
- package/dist/jams/cache.d.ts +1 -1
- package/dist/jams/cache.js +2 -1
- package/dist/jams/finders.d.ts +2 -1
- package/dist/jams/finders.js +18 -7
- package/dist/jams/helpers.d.ts +8 -4
- package/dist/jams/index.d.ts +4 -3
- package/dist/jams/index.js +23 -12
- package/dist/jams/livekit.d.ts +46 -8
- package/dist/jams/livekit.js +103 -21
- package/dist/jams/mapping.d.ts +14 -4
- package/dist/jams/mutations.d.ts +2 -0
- package/dist/jams/rtmp.d.ts +5 -0
- package/dist/jams/rtmp.js +8 -0
- package/dist/jams/token.d.ts +3 -3
- package/dist/jams/token.js +15 -12
- package/dist/jams/waitingRoom.d.ts +6 -4
- package/dist/jams/waitingRoom.js +33 -24
- package/dist/migration/index.d.ts +4 -0
- package/dist/migration/index.js +4 -0
- package/dist/notifications/defaultNotifications/groupMemberJoined/index.js +3 -1
- package/dist/notifications/defaultNotifications/groupMemberLeft/index.js +3 -1
- package/dist/notifications/helpers.js +6 -2
- package/dist/notifications/jobs.js +13 -2
- package/dist/notifications/push.js +11 -4
- package/dist/plugins/helpers.d.ts +6 -2
- package/dist/plugins/helpers.js +22 -10
- package/dist/plugins/index.d.ts +6 -1
- package/dist/plugins/index.js +54 -13
- package/dist/plugins/install.d.ts +20 -0
- package/dist/plugins/install.js +223 -0
- package/dist/plugins/state.d.ts +4 -0
- package/dist/plugins/state.js +29 -0
- package/dist/posts/contextClosure.d.ts +2 -1
- package/dist/posts/contextClosure.js +6 -1
- package/dist/posts/conversationQueries.d.ts +23 -0
- package/dist/posts/conversationQueries.js +135 -0
- package/dist/posts/eventAgenda.d.ts +165 -0
- package/dist/posts/eventAgenda.js +120 -0
- package/dist/posts/eventOccurrenceJobs.d.ts +4 -0
- package/dist/posts/eventOccurrenceJobs.js +23 -0
- package/dist/posts/eventOccurrences.d.ts +4 -0
- package/dist/posts/eventOccurrences.js +40 -0
- package/dist/posts/finders.d.ts +39 -13
- package/dist/posts/finders.js +51 -66
- package/dist/posts/helpers/filters.js +1 -1
- package/dist/posts/helpers/index.d.ts +120 -34
- package/dist/posts/helpers/index.js +34 -21
- package/dist/posts/index.d.ts +4 -0
- package/dist/posts/index.js +4 -0
- package/dist/posts/mapping.d.ts +454 -0
- package/dist/posts/mapping.js +43 -9
- package/dist/posts/mutations.d.ts +4 -2
- package/dist/posts/mutations.js +49 -16
- package/dist/posts/rsvpConfirmationEmail.js +2 -1
- package/dist/posts/unseenCounts.d.ts +12 -0
- package/dist/posts/unseenCounts.js +98 -0
- package/dist/profiles/cache.d.ts +5 -1
- package/dist/profiles/cache.js +27 -1
- package/dist/profiles/helpers.d.ts +5 -5
- package/dist/profiles/index.d.ts +1 -0
- package/dist/profiles/index.js +1 -0
- package/dist/profiles/mapping.d.ts +45 -4
- package/dist/profiles/mapping.js +24 -0
- package/dist/profiles/mutations.js +12 -14
- package/dist/pushSubscriptions/helpers.d.ts +2 -2
- package/dist/pushSubscriptions/mutations.js +13 -1
- package/dist/reports/helpers.d.ts +6 -6
- package/dist/reports/helpers.js +2 -1
- package/dist/reports/mapping.js +6 -2
- package/dist/roles/defaults.js +1 -0
- package/dist/roles/mutations.d.ts +3 -3
- package/dist/roles/mutations.js +5 -3
- package/dist/server/index.d.ts +15 -7
- package/dist/server/index.js +15 -8
- package/dist/session/index.d.ts +28 -0
- package/dist/session/index.js +79 -0
- package/dist/stats/finders.d.ts +1912 -362
- package/dist/stats/mapping.d.ts +26 -5
- package/package.json +7 -12
- package/dist/db/arango.d.ts +0 -2
- package/dist/db/arango.js +0 -110
- package/dist/db/migration/autoMigrate.d.ts +0 -2
- package/dist/db/migration/autoMigrate.js +0 -111
- package/dist/db/migration/cli.d.ts +0 -1
- package/dist/db/migration/cli.js +0 -56
- package/dist/db/migration/exportArango.d.ts +0 -4
- package/dist/db/migration/exportArango.js +0 -80
- package/dist/db/replaceHostname.d.ts +0 -1
- package/dist/db/replaceHostname.js +0 -88
|
@@ -35,7 +35,7 @@ export declare const entryConnector: (db: import("../../db").PgDb, from: Profile
|
|
|
35
35
|
};
|
|
36
36
|
description?: string | undefined;
|
|
37
37
|
blurhash?: string | undefined;
|
|
38
|
-
status?: "
|
|
38
|
+
status?: "failed" | "processing" | "ready" | undefined;
|
|
39
39
|
error?: string | undefined;
|
|
40
40
|
}[] | undefined;
|
|
41
41
|
customEmojis?: {
|
|
@@ -72,7 +72,7 @@ export declare const entryConnector: (db: import("../../db").PgDb, from: Profile
|
|
|
72
72
|
};
|
|
73
73
|
description?: string | undefined;
|
|
74
74
|
blurhash?: string | undefined;
|
|
75
|
-
status?: "
|
|
75
|
+
status?: "failed" | "processing" | "ready" | undefined;
|
|
76
76
|
error?: string | undefined;
|
|
77
77
|
}[] | undefined;
|
|
78
78
|
customEmojis?: {
|
|
@@ -110,7 +110,7 @@ export declare const entryConnector: (db: import("../../db").PgDb, from: Profile
|
|
|
110
110
|
};
|
|
111
111
|
description?: string | undefined;
|
|
112
112
|
blurhash?: string | undefined;
|
|
113
|
-
status?: "
|
|
113
|
+
status?: "failed" | "processing" | "ready" | undefined;
|
|
114
114
|
error?: string | undefined;
|
|
115
115
|
}[] | undefined;
|
|
116
116
|
customEmojis?: {
|
|
@@ -149,6 +149,27 @@ export declare const entryConnector: (db: import("../../db").PgDb, from: Profile
|
|
|
149
149
|
} | undefined;
|
|
150
150
|
} | undefined;
|
|
151
151
|
url?: string | undefined;
|
|
152
|
+
recurrence?: {
|
|
153
|
+
freq: "DAILY" | "WEEKLY" | "MONTHLY";
|
|
154
|
+
interval?: number | undefined;
|
|
155
|
+
byDay?: ("MO" | "TU" | "WE" | "TH" | "FR" | "SA" | "SU")[] | undefined;
|
|
156
|
+
until?: string | undefined;
|
|
157
|
+
count?: number | undefined;
|
|
158
|
+
} | undefined;
|
|
159
|
+
exceptions?: {
|
|
160
|
+
recurrenceId: string;
|
|
161
|
+
cancelled?: boolean | undefined;
|
|
162
|
+
start?: string | undefined;
|
|
163
|
+
end?: string | undefined;
|
|
164
|
+
physicalLocation?: {
|
|
165
|
+
text: string;
|
|
166
|
+
coordinates?: {
|
|
167
|
+
lat: number;
|
|
168
|
+
lng: number;
|
|
169
|
+
alt?: number | undefined;
|
|
170
|
+
} | undefined;
|
|
171
|
+
} | undefined;
|
|
172
|
+
}[] | undefined;
|
|
152
173
|
} | {
|
|
153
174
|
type: "article";
|
|
154
175
|
content?: string | undefined;
|
|
@@ -171,7 +192,7 @@ export declare const entryConnector: (db: import("../../db").PgDb, from: Profile
|
|
|
171
192
|
};
|
|
172
193
|
description?: string | undefined;
|
|
173
194
|
blurhash?: string | undefined;
|
|
174
|
-
status?: "
|
|
195
|
+
status?: "failed" | "processing" | "ready" | undefined;
|
|
175
196
|
error?: string | undefined;
|
|
176
197
|
}[] | undefined;
|
|
177
198
|
customEmojis?: {
|
|
@@ -209,7 +230,7 @@ export declare const entryConnector: (db: import("../../db").PgDb, from: Profile
|
|
|
209
230
|
};
|
|
210
231
|
description?: string | undefined;
|
|
211
232
|
blurhash?: string | undefined;
|
|
212
|
-
status?: "
|
|
233
|
+
status?: "failed" | "processing" | "ready" | undefined;
|
|
213
234
|
error?: string | undefined;
|
|
214
235
|
}[] | undefined;
|
|
215
236
|
customEmojis?: {
|
|
@@ -246,7 +267,7 @@ export declare const entryConnector: (db: import("../../db").PgDb, from: Profile
|
|
|
246
267
|
};
|
|
247
268
|
description?: string | undefined;
|
|
248
269
|
blurhash?: string | undefined;
|
|
249
|
-
status?: "
|
|
270
|
+
status?: "failed" | "processing" | "ready" | undefined;
|
|
250
271
|
error?: string | undefined;
|
|
251
272
|
}[] | undefined;
|
|
252
273
|
customEmojis?: {
|
|
@@ -284,7 +305,7 @@ export declare const entryConnector: (db: import("../../db").PgDb, from: Profile
|
|
|
284
305
|
};
|
|
285
306
|
description?: string | undefined;
|
|
286
307
|
blurhash?: string | undefined;
|
|
287
|
-
status?: "
|
|
308
|
+
status?: "failed" | "processing" | "ready" | undefined;
|
|
288
309
|
error?: string | undefined;
|
|
289
310
|
}[] | undefined;
|
|
290
311
|
customEmojis?: {
|
|
@@ -323,6 +344,27 @@ export declare const entryConnector: (db: import("../../db").PgDb, from: Profile
|
|
|
323
344
|
} | undefined;
|
|
324
345
|
} | undefined;
|
|
325
346
|
url?: string | undefined;
|
|
347
|
+
recurrence?: {
|
|
348
|
+
freq: "DAILY" | "WEEKLY" | "MONTHLY";
|
|
349
|
+
interval?: number | undefined;
|
|
350
|
+
byDay?: ("MO" | "TU" | "WE" | "TH" | "FR" | "SA" | "SU")[] | undefined;
|
|
351
|
+
until?: string | undefined;
|
|
352
|
+
count?: number | undefined;
|
|
353
|
+
} | undefined;
|
|
354
|
+
exceptions?: {
|
|
355
|
+
recurrenceId: string;
|
|
356
|
+
cancelled?: boolean | undefined;
|
|
357
|
+
start?: string | undefined;
|
|
358
|
+
end?: string | undefined;
|
|
359
|
+
physicalLocation?: {
|
|
360
|
+
text: string;
|
|
361
|
+
coordinates?: {
|
|
362
|
+
lat: number;
|
|
363
|
+
lng: number;
|
|
364
|
+
alt?: number | undefined;
|
|
365
|
+
} | undefined;
|
|
366
|
+
} | undefined;
|
|
367
|
+
}[] | undefined;
|
|
326
368
|
} | {
|
|
327
369
|
type: "article";
|
|
328
370
|
content?: string | undefined;
|
|
@@ -345,7 +387,7 @@ export declare const entryConnector: (db: import("../../db").PgDb, from: Profile
|
|
|
345
387
|
};
|
|
346
388
|
description?: string | undefined;
|
|
347
389
|
blurhash?: string | undefined;
|
|
348
|
-
status?: "
|
|
390
|
+
status?: "failed" | "processing" | "ready" | undefined;
|
|
349
391
|
error?: string | undefined;
|
|
350
392
|
}[] | undefined;
|
|
351
393
|
customEmojis?: {
|
|
@@ -370,7 +412,8 @@ export declare const entryConnector: (db: import("../../db").PgDb, from: Profile
|
|
|
370
412
|
} | {
|
|
371
413
|
type: "rsvp";
|
|
372
414
|
data: {
|
|
373
|
-
response: "
|
|
415
|
+
response: "removed" | "no" | "yes" | "tentative";
|
|
416
|
+
recurrenceId?: string | undefined;
|
|
374
417
|
};
|
|
375
418
|
}) & {
|
|
376
419
|
id?: string;
|
|
@@ -398,7 +441,7 @@ export declare const entryConnector: (db: import("../../db").PgDb, from: Profile
|
|
|
398
441
|
};
|
|
399
442
|
description?: string | undefined;
|
|
400
443
|
blurhash?: string | undefined;
|
|
401
|
-
status?: "
|
|
444
|
+
status?: "failed" | "processing" | "ready" | undefined;
|
|
402
445
|
error?: string | undefined;
|
|
403
446
|
}[] | undefined;
|
|
404
447
|
customEmojis?: {
|
|
@@ -435,7 +478,7 @@ export declare const entryConnector: (db: import("../../db").PgDb, from: Profile
|
|
|
435
478
|
};
|
|
436
479
|
description?: string | undefined;
|
|
437
480
|
blurhash?: string | undefined;
|
|
438
|
-
status?: "
|
|
481
|
+
status?: "failed" | "processing" | "ready" | undefined;
|
|
439
482
|
error?: string | undefined;
|
|
440
483
|
}[] | undefined;
|
|
441
484
|
customEmojis?: {
|
|
@@ -473,7 +516,7 @@ export declare const entryConnector: (db: import("../../db").PgDb, from: Profile
|
|
|
473
516
|
};
|
|
474
517
|
description?: string | undefined;
|
|
475
518
|
blurhash?: string | undefined;
|
|
476
|
-
status?: "
|
|
519
|
+
status?: "failed" | "processing" | "ready" | undefined;
|
|
477
520
|
error?: string | undefined;
|
|
478
521
|
}[] | undefined;
|
|
479
522
|
customEmojis?: {
|
|
@@ -512,6 +555,27 @@ export declare const entryConnector: (db: import("../../db").PgDb, from: Profile
|
|
|
512
555
|
} | undefined;
|
|
513
556
|
} | undefined;
|
|
514
557
|
url?: string | undefined;
|
|
558
|
+
recurrence?: {
|
|
559
|
+
freq: "DAILY" | "WEEKLY" | "MONTHLY";
|
|
560
|
+
interval?: number | undefined;
|
|
561
|
+
byDay?: ("MO" | "TU" | "WE" | "TH" | "FR" | "SA" | "SU")[] | undefined;
|
|
562
|
+
until?: string | undefined;
|
|
563
|
+
count?: number | undefined;
|
|
564
|
+
} | undefined;
|
|
565
|
+
exceptions?: {
|
|
566
|
+
recurrenceId: string;
|
|
567
|
+
cancelled?: boolean | undefined;
|
|
568
|
+
start?: string | undefined;
|
|
569
|
+
end?: string | undefined;
|
|
570
|
+
physicalLocation?: {
|
|
571
|
+
text: string;
|
|
572
|
+
coordinates?: {
|
|
573
|
+
lat: number;
|
|
574
|
+
lng: number;
|
|
575
|
+
alt?: number | undefined;
|
|
576
|
+
} | undefined;
|
|
577
|
+
} | undefined;
|
|
578
|
+
}[] | undefined;
|
|
515
579
|
} | {
|
|
516
580
|
type: "article";
|
|
517
581
|
content?: string | undefined;
|
|
@@ -534,7 +598,7 @@ export declare const entryConnector: (db: import("../../db").PgDb, from: Profile
|
|
|
534
598
|
};
|
|
535
599
|
description?: string | undefined;
|
|
536
600
|
blurhash?: string | undefined;
|
|
537
|
-
status?: "
|
|
601
|
+
status?: "failed" | "processing" | "ready" | undefined;
|
|
538
602
|
error?: string | undefined;
|
|
539
603
|
}[] | undefined;
|
|
540
604
|
customEmojis?: {
|
|
@@ -572,7 +636,7 @@ export declare const entryConnector: (db: import("../../db").PgDb, from: Profile
|
|
|
572
636
|
};
|
|
573
637
|
description?: string | undefined;
|
|
574
638
|
blurhash?: string | undefined;
|
|
575
|
-
status?: "
|
|
639
|
+
status?: "failed" | "processing" | "ready" | undefined;
|
|
576
640
|
error?: string | undefined;
|
|
577
641
|
}[] | undefined;
|
|
578
642
|
customEmojis?: {
|
|
@@ -609,7 +673,7 @@ export declare const entryConnector: (db: import("../../db").PgDb, from: Profile
|
|
|
609
673
|
};
|
|
610
674
|
description?: string | undefined;
|
|
611
675
|
blurhash?: string | undefined;
|
|
612
|
-
status?: "
|
|
676
|
+
status?: "failed" | "processing" | "ready" | undefined;
|
|
613
677
|
error?: string | undefined;
|
|
614
678
|
}[] | undefined;
|
|
615
679
|
customEmojis?: {
|
|
@@ -647,7 +711,7 @@ export declare const entryConnector: (db: import("../../db").PgDb, from: Profile
|
|
|
647
711
|
};
|
|
648
712
|
description?: string | undefined;
|
|
649
713
|
blurhash?: string | undefined;
|
|
650
|
-
status?: "
|
|
714
|
+
status?: "failed" | "processing" | "ready" | undefined;
|
|
651
715
|
error?: string | undefined;
|
|
652
716
|
}[] | undefined;
|
|
653
717
|
customEmojis?: {
|
|
@@ -686,6 +750,27 @@ export declare const entryConnector: (db: import("../../db").PgDb, from: Profile
|
|
|
686
750
|
} | undefined;
|
|
687
751
|
} | undefined;
|
|
688
752
|
url?: string | undefined;
|
|
753
|
+
recurrence?: {
|
|
754
|
+
freq: "DAILY" | "WEEKLY" | "MONTHLY";
|
|
755
|
+
interval?: number | undefined;
|
|
756
|
+
byDay?: ("MO" | "TU" | "WE" | "TH" | "FR" | "SA" | "SU")[] | undefined;
|
|
757
|
+
until?: string | undefined;
|
|
758
|
+
count?: number | undefined;
|
|
759
|
+
} | undefined;
|
|
760
|
+
exceptions?: {
|
|
761
|
+
recurrenceId: string;
|
|
762
|
+
cancelled?: boolean | undefined;
|
|
763
|
+
start?: string | undefined;
|
|
764
|
+
end?: string | undefined;
|
|
765
|
+
physicalLocation?: {
|
|
766
|
+
text: string;
|
|
767
|
+
coordinates?: {
|
|
768
|
+
lat: number;
|
|
769
|
+
lng: number;
|
|
770
|
+
alt?: number | undefined;
|
|
771
|
+
} | undefined;
|
|
772
|
+
} | undefined;
|
|
773
|
+
}[] | undefined;
|
|
689
774
|
} | {
|
|
690
775
|
type: "article";
|
|
691
776
|
content?: string | undefined;
|
|
@@ -708,7 +793,7 @@ export declare const entryConnector: (db: import("../../db").PgDb, from: Profile
|
|
|
708
793
|
};
|
|
709
794
|
description?: string | undefined;
|
|
710
795
|
blurhash?: string | undefined;
|
|
711
|
-
status?: "
|
|
796
|
+
status?: "failed" | "processing" | "ready" | undefined;
|
|
712
797
|
error?: string | undefined;
|
|
713
798
|
}[] | undefined;
|
|
714
799
|
customEmojis?: {
|
|
@@ -733,16 +818,17 @@ export declare const entryConnector: (db: import("../../db").PgDb, from: Profile
|
|
|
733
818
|
} | {
|
|
734
819
|
type: "rsvp";
|
|
735
820
|
data: {
|
|
736
|
-
response: "
|
|
821
|
+
response: "removed" | "no" | "yes" | "tentative";
|
|
822
|
+
recurrenceId?: string | undefined;
|
|
737
823
|
};
|
|
738
824
|
}) & {
|
|
739
825
|
_from: string;
|
|
740
826
|
_to: string;
|
|
741
827
|
}>>;
|
|
742
828
|
export declare const entryDisconnector: (db: import("../../db").PgDb, from: Profile, to: Post) => Promise<void>;
|
|
743
|
-
export declare const replyConnector: (db: import("../../db").PgDb, from: Post, to: Post, data?: {
|
|
829
|
+
export declare const replyConnector: (db: import("../../db").PgDb, from: Post, to: Post, data?: object & {
|
|
744
830
|
id?: string;
|
|
745
|
-
}) => Promise<import("../../db/pg/map").WithId<{
|
|
831
|
+
}) => Promise<import("../../db/pg/map").WithId<object & {
|
|
746
832
|
_from: string;
|
|
747
833
|
_to: string;
|
|
748
834
|
}>>;
|
|
@@ -765,22 +851,22 @@ export declare const groupConnector: (db: import("../../db").PgDb, from: Post, t
|
|
|
765
851
|
discoverable?: boolean | undefined;
|
|
766
852
|
lastPostAt?: string | null | undefined;
|
|
767
853
|
deletedAt?: string | null | undefined;
|
|
768
|
-
}, data?: {
|
|
854
|
+
}, data?: object & {
|
|
769
855
|
id?: string;
|
|
770
|
-
}) => Promise<import("../../db/pg/map").WithId<{
|
|
856
|
+
}) => Promise<import("../../db/pg/map").WithId<object & {
|
|
771
857
|
_from: string;
|
|
772
858
|
_to: string;
|
|
773
859
|
}>>;
|
|
774
|
-
export declare const audienceConnector: (db: import("../../db").PgDb, from: Post, to: Profile, data?: {
|
|
860
|
+
export declare const audienceConnector: (db: import("../../db").PgDb, from: Post, to: Profile, data?: object & {
|
|
775
861
|
id?: string;
|
|
776
|
-
}) => Promise<import("../../db/pg/map").WithId<{
|
|
862
|
+
}) => Promise<import("../../db/pg/map").WithId<object & {
|
|
777
863
|
_from: string;
|
|
778
864
|
_to: string;
|
|
779
865
|
}>>;
|
|
780
|
-
export declare const audienceConnectionFinder: (db: import("../../db").PgDb, from: Post, to: Profile) => Promise<
|
|
781
|
-
export declare const hashtagConnector: (db: import("../../db").PgDb, from: Post, to: Hashtag, data?: {
|
|
866
|
+
export declare const audienceConnectionFinder: (db: import("../../db").PgDb, from: Post, to: Profile) => Promise<Record<string, unknown> | undefined>;
|
|
867
|
+
export declare const hashtagConnector: (db: import("../../db").PgDb, from: Post, to: Hashtag, data?: object & {
|
|
782
868
|
id?: string;
|
|
783
|
-
}) => Promise<import("../../db/pg/map").WithId<{
|
|
869
|
+
}) => Promise<import("../../db/pg/map").WithId<object & {
|
|
784
870
|
_from: string;
|
|
785
871
|
_to: string;
|
|
786
872
|
}>>;
|
|
@@ -795,10 +881,10 @@ export declare const mentionConnector: (db: import("../../db").PgDb, from: Post,
|
|
|
795
881
|
_from: string;
|
|
796
882
|
_to: string;
|
|
797
883
|
}>>;
|
|
798
|
-
export declare const mentionsConnectionFinder: (db: import("../../db").PgDb, from: Post, to: Profile) => Promise<
|
|
799
|
-
export declare const repostConnector: (db: import("../../db").PgDb, from: Post, to: Post, data?: {
|
|
884
|
+
export declare const mentionsConnectionFinder: (db: import("../../db").PgDb, from: Post, to: Profile) => Promise<Record<string, unknown> | undefined>;
|
|
885
|
+
export declare const repostConnector: (db: import("../../db").PgDb, from: Post, to: Post, data?: object & {
|
|
800
886
|
id?: string;
|
|
801
|
-
}) => Promise<import("../../db/pg/map").WithId<{
|
|
887
|
+
}) => Promise<import("../../db/pg/map").WithId<object & {
|
|
802
888
|
_from: string;
|
|
803
889
|
_to: string;
|
|
804
890
|
}>>;
|
|
@@ -813,16 +899,16 @@ export declare const reactionConnector: (db: import("../../db").PgDb, from: Prof
|
|
|
813
899
|
_to: string;
|
|
814
900
|
}>>;
|
|
815
901
|
export declare const reactionDisconnector: (db: import("../../db").PgDb, from: Profile, to: Post) => Promise<void>;
|
|
816
|
-
export declare const bookmarkConnector: (db: import("../../db").PgDb, from: Profile, to: Post, data?: {
|
|
902
|
+
export declare const bookmarkConnector: (db: import("../../db").PgDb, from: Profile, to: Post, data?: object & {
|
|
817
903
|
id?: string;
|
|
818
|
-
}) => Promise<import("../../db/pg/map").WithId<{
|
|
904
|
+
}) => Promise<import("../../db/pg/map").WithId<object & {
|
|
819
905
|
_from: string;
|
|
820
906
|
_to: string;
|
|
821
907
|
}>>;
|
|
822
908
|
export declare const bookmarkDisconnector: (db: import("../../db").PgDb, from: Profile, to: Post) => Promise<void>;
|
|
823
|
-
export declare const postSeenConnector: (db: import("../../db").PgDb, from: Profile, to: Post, data?: {
|
|
909
|
+
export declare const postSeenConnector: (db: import("../../db").PgDb, from: Profile, to: Post, data?: object & {
|
|
824
910
|
id?: string;
|
|
825
|
-
}) => Promise<import("../../db/pg/map").WithId<{
|
|
911
|
+
}) => Promise<import("../../db/pg/map").WithId<object & {
|
|
826
912
|
_from: string;
|
|
827
913
|
_to: string;
|
|
828
914
|
}>>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { hashtagRegex, normalizeHashtagTag,
|
|
1
|
+
import { hashtagRegex, normalizeHashtagTag, } from '@openpeepshq/common/types';
|
|
2
2
|
import { findProfileByHandle } from '../../profiles/finders.js';
|
|
3
|
+
import { getPublicProfile } from '../../profiles/cache.js';
|
|
3
4
|
import { composeFilters, connectionFinder, connector, disconnector, filterAndTransform, } from '../../db/helpers.js';
|
|
4
5
|
import { allpeepDb, collectionInfos } from '../../db/index.js';
|
|
5
6
|
import { capabilitiesConfig } from '../../config/index.js';
|
|
6
7
|
import { canReadPost } from './filters.js';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
8
|
+
import { matchMentionHandles, normalizePostDataFromDb, tombstoneProfileWithMetaIfDeleted, } from '@openpeepshq/common/lib';
|
|
9
|
+
import { EMBEDDED_REPOSTS_LIMIT } from '../mapping.js';
|
|
9
10
|
export const isDirect = (post) => post.visibility === 'direct';
|
|
10
11
|
export const isPrivate = (post) => post.visibility === 'private';
|
|
11
12
|
export const isUnlisted = (post) => post.visibility === 'unlisted';
|
|
@@ -24,22 +25,7 @@ export const extractHashtags = (data) => {
|
|
|
24
25
|
return getTags(data === null || data === void 0 ? void 0 : data.content);
|
|
25
26
|
}
|
|
26
27
|
};
|
|
27
|
-
export const extractMentionHandles = (text) =>
|
|
28
|
-
if (!text) {
|
|
29
|
-
return [];
|
|
30
|
-
}
|
|
31
|
-
const handles = new Set();
|
|
32
|
-
for (const word of text.split(/\s+/)) {
|
|
33
|
-
if (!word.startsWith('@')) {
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
const handle = word.slice(1);
|
|
37
|
-
if (handleRegex.test(handle)) {
|
|
38
|
-
handles.add(handle);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return [...handles];
|
|
42
|
-
};
|
|
28
|
+
export const extractMentionHandles = (text) => matchMentionHandles(text);
|
|
43
29
|
export const resolveMentionsForPost = async (data) => {
|
|
44
30
|
const byProfileId = new Map();
|
|
45
31
|
for (const handle of extractMentionHandles(data.content)) {
|
|
@@ -66,12 +52,36 @@ export const reactionDisconnector = disconnector(collectionInfos.profilesCollect
|
|
|
66
52
|
export const bookmarkConnector = connector(collectionInfos.profilesCollection, collectionInfos.postsCollection, collectionInfos.bookmarksCollection);
|
|
67
53
|
export const bookmarkDisconnector = disconnector(collectionInfos.profilesCollection, collectionInfos.postsCollection, collectionInfos.bookmarksCollection);
|
|
68
54
|
export const postSeenConnector = connector(collectionInfos.profilesCollection, collectionInfos.postsCollection, collectionInfos.postSeenCollection);
|
|
69
|
-
const loadPublicProfile = async (profileId, ignoreSoftDelete = false) =>
|
|
55
|
+
const loadPublicProfile = async (profileId, ignoreSoftDelete = false) => tombstoneProfileWithMetaIfDeleted(await getPublicProfile(profileId, ignoreSoftDelete));
|
|
70
56
|
const addProfileForEntry = async (rawEntry) => (Object.assign(Object.assign({}, rawEntry), {
|
|
71
57
|
// ignoreSoftDelete: authorship must survive account removal
|
|
72
58
|
profile: (await loadPublicProfile(rawEntry.profile.id, true)) }));
|
|
73
59
|
const addProfileForReaction = async (rawReaction) => (Object.assign(Object.assign({}, rawReaction), { profile: (await loadPublicProfile(rawReaction.profile.id, true)) }));
|
|
74
60
|
const addProfileForMention = async (rawMention) => (Object.assign(Object.assign({}, rawMention), { profile: (await loadPublicProfile(rawMention.profile.id, true)) }));
|
|
61
|
+
const leanRepostsFromWrappers = async (wrappers) => {
|
|
62
|
+
if (!(wrappers === null || wrappers === void 0 ? void 0 : wrappers.length))
|
|
63
|
+
return [];
|
|
64
|
+
const withProfiles = await Promise.all(wrappers.map(async (wrapper) => {
|
|
65
|
+
var _a, _b, _c;
|
|
66
|
+
const createEntry = (_a = wrapper.entries) === null || _a === void 0 ? void 0 : _a.find((entry) => entry.type === 'create');
|
|
67
|
+
const profileId = (_c = (_b = createEntry === null || createEntry === void 0 ? void 0 : createEntry.profile) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : wrapper.creatorId;
|
|
68
|
+
if (!profileId)
|
|
69
|
+
return null;
|
|
70
|
+
const profile = (createEntry === null || createEntry === void 0 ? void 0 : createEntry.profile)
|
|
71
|
+
? await loadPublicProfile(createEntry.profile.id, true)
|
|
72
|
+
: await loadPublicProfile(profileId, true);
|
|
73
|
+
if (!profile)
|
|
74
|
+
return null;
|
|
75
|
+
return {
|
|
76
|
+
profile,
|
|
77
|
+
createdAt: wrapper.createdAt,
|
|
78
|
+
};
|
|
79
|
+
}));
|
|
80
|
+
return withProfiles
|
|
81
|
+
.filter((r) => !!r)
|
|
82
|
+
.sort((a, b) => (a.createdAt < b.createdAt ? 1 : -1))
|
|
83
|
+
.slice(0, EMBEDDED_REPOSTS_LIMIT);
|
|
84
|
+
};
|
|
75
85
|
export const transformPost = async (post, currentProfile) => {
|
|
76
86
|
var _a;
|
|
77
87
|
const entries = post.entries
|
|
@@ -80,6 +90,7 @@ export const transformPost = async (post, currentProfile) => {
|
|
|
80
90
|
const reactions = post.reactions
|
|
81
91
|
? await Promise.all(post.reactions.map(addProfileForReaction))
|
|
82
92
|
: [];
|
|
93
|
+
const reposts = await leanRepostsFromWrappers(post.reposts);
|
|
83
94
|
const audience = post.audience
|
|
84
95
|
? (await Promise.all(post.audience.map((p) => loadPublicProfile(p.id)))).filter((profile) => !!profile)
|
|
85
96
|
: [];
|
|
@@ -99,10 +110,12 @@ export const transformPost = async (post, currentProfile) => {
|
|
|
99
110
|
.map((entry) => ({
|
|
100
111
|
profile: entry.profile,
|
|
101
112
|
response: entry.data.response,
|
|
113
|
+
recurrenceId: entry.data.recurrenceId,
|
|
102
114
|
createdAt: entry.createdAt,
|
|
103
115
|
})), audience,
|
|
104
116
|
mentions, profile: profile, entries,
|
|
105
|
-
reactions
|
|
117
|
+
reactions,
|
|
118
|
+
reposts });
|
|
106
119
|
};
|
|
107
120
|
export const toFilteredPostsList = async (queryResult, options) => {
|
|
108
121
|
const { authData, limit = 100, offset = 0, filters = [] } = options;
|
package/dist/posts/index.d.ts
CHANGED
|
@@ -2,5 +2,9 @@ export * from './finders';
|
|
|
2
2
|
export * from './mutations';
|
|
3
3
|
export * from './mapping';
|
|
4
4
|
export { CONTEXT_NODE_CAP, collectReplyClosureIds, loadReplyContextPosts, } from './contextClosure';
|
|
5
|
+
export { listConversationPreviews, getConversationThread, findLatestThreadPostId, } from './conversationQueries';
|
|
5
6
|
export * from './helpers';
|
|
6
7
|
export { registerRsvpConfirmationEmail } from './rsvpConfirmationEmail';
|
|
8
|
+
export { rebuildEventOccurrences, clearEventOccurrences, rebuildRecurringEventOccurrences, } from './eventOccurrences';
|
|
9
|
+
export { listEventAgenda } from './eventAgenda';
|
|
10
|
+
export { eventOccurrenceQueue, eventOccurrenceWorker, ensureEventOccurrenceSchedule, } from './eventOccurrenceJobs';
|
package/dist/posts/index.js
CHANGED
|
@@ -2,5 +2,9 @@ export * from './finders.js';
|
|
|
2
2
|
export * from './mutations.js';
|
|
3
3
|
export * from './mapping.js';
|
|
4
4
|
export { CONTEXT_NODE_CAP, collectReplyClosureIds, loadReplyContextPosts, } from './contextClosure.js';
|
|
5
|
+
export { listConversationPreviews, getConversationThread, findLatestThreadPostId, } from './conversationQueries.js';
|
|
5
6
|
export * from './helpers/index.js';
|
|
6
7
|
export { registerRsvpConfirmationEmail } from './rsvpConfirmationEmail.js';
|
|
8
|
+
export { rebuildEventOccurrences, clearEventOccurrences, rebuildRecurringEventOccurrences, } from './eventOccurrences.js';
|
|
9
|
+
export { listEventAgenda } from './eventAgenda.js';
|
|
10
|
+
export { eventOccurrenceQueue, eventOccurrenceWorker, ensureEventOccurrenceSchedule, } from './eventOccurrenceJobs.js';
|