@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
package/dist/posts/mapping.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { Mapping, Relation, RelationWithMapping } from '../db/pg/map';
|
|
|
2
2
|
import { EntryData, Profile, DbPost, DbBasePost } from '@openpeepshq/common/types';
|
|
3
3
|
export declare const entriesRelation: Relation<Profile, EntryData>;
|
|
4
4
|
export declare const groupRelation: Relation;
|
|
5
|
+
/** Cap for embedded who-reposted lists on feed/detail posts. */
|
|
6
|
+
export declare const EMBEDDED_REPOSTS_LIMIT = 50;
|
|
5
7
|
export declare const repostRelation: RelationWithMapping<DbBasePost>;
|
|
6
8
|
export declare const repostRelationForProfile: (profile?: {
|
|
7
9
|
id: string;
|
|
@@ -151,6 +153,27 @@ export declare const postsWithReplyCountMapping: Mapping<{
|
|
|
151
153
|
} | undefined;
|
|
152
154
|
} | undefined;
|
|
153
155
|
url?: string | undefined;
|
|
156
|
+
recurrence?: {
|
|
157
|
+
freq: "DAILY" | "WEEKLY" | "MONTHLY";
|
|
158
|
+
interval?: number | undefined;
|
|
159
|
+
byDay?: ("MO" | "TU" | "WE" | "TH" | "FR" | "SA" | "SU")[] | undefined;
|
|
160
|
+
until?: string | undefined;
|
|
161
|
+
count?: number | undefined;
|
|
162
|
+
} | undefined;
|
|
163
|
+
exceptions?: {
|
|
164
|
+
recurrenceId: string;
|
|
165
|
+
cancelled?: boolean | undefined;
|
|
166
|
+
start?: string | undefined;
|
|
167
|
+
end?: string | undefined;
|
|
168
|
+
physicalLocation?: {
|
|
169
|
+
text: string;
|
|
170
|
+
coordinates?: {
|
|
171
|
+
lat: number;
|
|
172
|
+
lng: number;
|
|
173
|
+
alt?: number | undefined;
|
|
174
|
+
} | undefined;
|
|
175
|
+
} | undefined;
|
|
176
|
+
}[] | undefined;
|
|
154
177
|
} | {
|
|
155
178
|
type: "article";
|
|
156
179
|
content?: string | undefined;
|
|
@@ -332,6 +355,27 @@ export declare const postsWithReplyCountMapping: Mapping<{
|
|
|
332
355
|
} | undefined;
|
|
333
356
|
} | undefined;
|
|
334
357
|
url?: string | undefined;
|
|
358
|
+
recurrence?: {
|
|
359
|
+
freq: "DAILY" | "WEEKLY" | "MONTHLY";
|
|
360
|
+
interval?: number | undefined;
|
|
361
|
+
byDay?: ("MO" | "TU" | "WE" | "TH" | "FR" | "SA" | "SU")[] | undefined;
|
|
362
|
+
until?: string | undefined;
|
|
363
|
+
count?: number | undefined;
|
|
364
|
+
} | undefined;
|
|
365
|
+
exceptions?: {
|
|
366
|
+
recurrenceId: string;
|
|
367
|
+
cancelled?: boolean | undefined;
|
|
368
|
+
start?: string | undefined;
|
|
369
|
+
end?: string | undefined;
|
|
370
|
+
physicalLocation?: {
|
|
371
|
+
text: string;
|
|
372
|
+
coordinates?: {
|
|
373
|
+
lat: number;
|
|
374
|
+
lng: number;
|
|
375
|
+
alt?: number | undefined;
|
|
376
|
+
} | undefined;
|
|
377
|
+
} | undefined;
|
|
378
|
+
}[] | undefined;
|
|
335
379
|
} | {
|
|
336
380
|
type: "article";
|
|
337
381
|
content?: string | undefined;
|
|
@@ -517,6 +561,27 @@ export declare const postsWithReplyCountMapping: Mapping<{
|
|
|
517
561
|
} | undefined;
|
|
518
562
|
} | undefined;
|
|
519
563
|
url?: string | undefined;
|
|
564
|
+
recurrence?: {
|
|
565
|
+
freq: "DAILY" | "WEEKLY" | "MONTHLY";
|
|
566
|
+
interval?: number | undefined;
|
|
567
|
+
byDay?: ("MO" | "TU" | "WE" | "TH" | "FR" | "SA" | "SU")[] | undefined;
|
|
568
|
+
until?: string | undefined;
|
|
569
|
+
count?: number | undefined;
|
|
570
|
+
} | undefined;
|
|
571
|
+
exceptions?: {
|
|
572
|
+
recurrenceId: string;
|
|
573
|
+
cancelled?: boolean | undefined;
|
|
574
|
+
start?: string | undefined;
|
|
575
|
+
end?: string | undefined;
|
|
576
|
+
physicalLocation?: {
|
|
577
|
+
text: string;
|
|
578
|
+
coordinates?: {
|
|
579
|
+
lat: number;
|
|
580
|
+
lng: number;
|
|
581
|
+
alt?: number | undefined;
|
|
582
|
+
} | undefined;
|
|
583
|
+
} | undefined;
|
|
584
|
+
}[] | undefined;
|
|
520
585
|
} | {
|
|
521
586
|
type: "article";
|
|
522
587
|
content?: string | undefined;
|
|
@@ -699,6 +764,27 @@ export declare const postsWithReplyToCountMapping: Mapping<{
|
|
|
699
764
|
} | undefined;
|
|
700
765
|
} | undefined;
|
|
701
766
|
url?: string | undefined;
|
|
767
|
+
recurrence?: {
|
|
768
|
+
freq: "DAILY" | "WEEKLY" | "MONTHLY";
|
|
769
|
+
interval?: number | undefined;
|
|
770
|
+
byDay?: ("MO" | "TU" | "WE" | "TH" | "FR" | "SA" | "SU")[] | undefined;
|
|
771
|
+
until?: string | undefined;
|
|
772
|
+
count?: number | undefined;
|
|
773
|
+
} | undefined;
|
|
774
|
+
exceptions?: {
|
|
775
|
+
recurrenceId: string;
|
|
776
|
+
cancelled?: boolean | undefined;
|
|
777
|
+
start?: string | undefined;
|
|
778
|
+
end?: string | undefined;
|
|
779
|
+
physicalLocation?: {
|
|
780
|
+
text: string;
|
|
781
|
+
coordinates?: {
|
|
782
|
+
lat: number;
|
|
783
|
+
lng: number;
|
|
784
|
+
alt?: number | undefined;
|
|
785
|
+
} | undefined;
|
|
786
|
+
} | undefined;
|
|
787
|
+
}[] | undefined;
|
|
702
788
|
} | {
|
|
703
789
|
type: "article";
|
|
704
790
|
content?: string | undefined;
|
|
@@ -880,6 +966,27 @@ export declare const postsWithReplyToCountMapping: Mapping<{
|
|
|
880
966
|
} | undefined;
|
|
881
967
|
} | undefined;
|
|
882
968
|
url?: string | undefined;
|
|
969
|
+
recurrence?: {
|
|
970
|
+
freq: "DAILY" | "WEEKLY" | "MONTHLY";
|
|
971
|
+
interval?: number | undefined;
|
|
972
|
+
byDay?: ("MO" | "TU" | "WE" | "TH" | "FR" | "SA" | "SU")[] | undefined;
|
|
973
|
+
until?: string | undefined;
|
|
974
|
+
count?: number | undefined;
|
|
975
|
+
} | undefined;
|
|
976
|
+
exceptions?: {
|
|
977
|
+
recurrenceId: string;
|
|
978
|
+
cancelled?: boolean | undefined;
|
|
979
|
+
start?: string | undefined;
|
|
980
|
+
end?: string | undefined;
|
|
981
|
+
physicalLocation?: {
|
|
982
|
+
text: string;
|
|
983
|
+
coordinates?: {
|
|
984
|
+
lat: number;
|
|
985
|
+
lng: number;
|
|
986
|
+
alt?: number | undefined;
|
|
987
|
+
} | undefined;
|
|
988
|
+
} | undefined;
|
|
989
|
+
}[] | undefined;
|
|
883
990
|
} | {
|
|
884
991
|
type: "article";
|
|
885
992
|
content?: string | undefined;
|
|
@@ -1065,6 +1172,27 @@ export declare const postsWithReplyToCountMapping: Mapping<{
|
|
|
1065
1172
|
} | undefined;
|
|
1066
1173
|
} | undefined;
|
|
1067
1174
|
url?: string | undefined;
|
|
1175
|
+
recurrence?: {
|
|
1176
|
+
freq: "DAILY" | "WEEKLY" | "MONTHLY";
|
|
1177
|
+
interval?: number | undefined;
|
|
1178
|
+
byDay?: ("MO" | "TU" | "WE" | "TH" | "FR" | "SA" | "SU")[] | undefined;
|
|
1179
|
+
until?: string | undefined;
|
|
1180
|
+
count?: number | undefined;
|
|
1181
|
+
} | undefined;
|
|
1182
|
+
exceptions?: {
|
|
1183
|
+
recurrenceId: string;
|
|
1184
|
+
cancelled?: boolean | undefined;
|
|
1185
|
+
start?: string | undefined;
|
|
1186
|
+
end?: string | undefined;
|
|
1187
|
+
physicalLocation?: {
|
|
1188
|
+
text: string;
|
|
1189
|
+
coordinates?: {
|
|
1190
|
+
lat: number;
|
|
1191
|
+
lng: number;
|
|
1192
|
+
alt?: number | undefined;
|
|
1193
|
+
} | undefined;
|
|
1194
|
+
} | undefined;
|
|
1195
|
+
}[] | undefined;
|
|
1068
1196
|
} | {
|
|
1069
1197
|
type: "article";
|
|
1070
1198
|
content?: string | undefined;
|
|
@@ -1247,6 +1375,227 @@ export declare const postsMapping: Mapping<{
|
|
|
1247
1375
|
} | undefined;
|
|
1248
1376
|
} | undefined;
|
|
1249
1377
|
url?: string | undefined;
|
|
1378
|
+
recurrence?: {
|
|
1379
|
+
freq: "DAILY" | "WEEKLY" | "MONTHLY";
|
|
1380
|
+
interval?: number | undefined;
|
|
1381
|
+
byDay?: ("MO" | "TU" | "WE" | "TH" | "FR" | "SA" | "SU")[] | undefined;
|
|
1382
|
+
until?: string | undefined;
|
|
1383
|
+
count?: number | undefined;
|
|
1384
|
+
} | undefined;
|
|
1385
|
+
exceptions?: {
|
|
1386
|
+
recurrenceId: string;
|
|
1387
|
+
cancelled?: boolean | undefined;
|
|
1388
|
+
start?: string | undefined;
|
|
1389
|
+
end?: string | undefined;
|
|
1390
|
+
physicalLocation?: {
|
|
1391
|
+
text: string;
|
|
1392
|
+
coordinates?: {
|
|
1393
|
+
lat: number;
|
|
1394
|
+
lng: number;
|
|
1395
|
+
alt?: number | undefined;
|
|
1396
|
+
} | undefined;
|
|
1397
|
+
} | undefined;
|
|
1398
|
+
}[] | undefined;
|
|
1399
|
+
} | {
|
|
1400
|
+
type: "article";
|
|
1401
|
+
content?: string | undefined;
|
|
1402
|
+
sensitive?: boolean | undefined;
|
|
1403
|
+
spoilerText?: string | undefined;
|
|
1404
|
+
attachments?: {
|
|
1405
|
+
type: string;
|
|
1406
|
+
url: string;
|
|
1407
|
+
previewUrl: string | null;
|
|
1408
|
+
textUrl: null;
|
|
1409
|
+
filename: string;
|
|
1410
|
+
meta: {
|
|
1411
|
+
usage?: string | undefined;
|
|
1412
|
+
focus?: {
|
|
1413
|
+
x: number;
|
|
1414
|
+
y: number;
|
|
1415
|
+
} | undefined;
|
|
1416
|
+
mimetype?: string | undefined;
|
|
1417
|
+
size?: number | undefined;
|
|
1418
|
+
};
|
|
1419
|
+
description?: string | undefined;
|
|
1420
|
+
blurhash?: string | undefined;
|
|
1421
|
+
status?: "ready" | "failed" | "processing" | undefined;
|
|
1422
|
+
error?: string | undefined;
|
|
1423
|
+
}[] | undefined;
|
|
1424
|
+
customEmojis?: {
|
|
1425
|
+
shortcode: string;
|
|
1426
|
+
url: string;
|
|
1427
|
+
staticUrl: string;
|
|
1428
|
+
visibleInPicker: boolean;
|
|
1429
|
+
category: string;
|
|
1430
|
+
}[] | undefined;
|
|
1431
|
+
language?: string | undefined;
|
|
1432
|
+
image?: string | undefined;
|
|
1433
|
+
title?: string | undefined;
|
|
1434
|
+
} | undefined;
|
|
1435
|
+
}, DbPost, DbPost>;
|
|
1436
|
+
/** Auth / mark-seen: post graph without nested replyTo/repost hydrate. */
|
|
1437
|
+
export declare const postsAuthMapping: Mapping<{
|
|
1438
|
+
type: "note" | "question" | "event" | "article";
|
|
1439
|
+
visibility: "direct" | "group" | "local" | "report" | "public" | "unlisted" | "private";
|
|
1440
|
+
creatorId: string;
|
|
1441
|
+
capabilitiesNeeded?: string[] | undefined;
|
|
1442
|
+
data?: {
|
|
1443
|
+
type: "note";
|
|
1444
|
+
content?: string | undefined;
|
|
1445
|
+
sensitive?: boolean | undefined;
|
|
1446
|
+
spoilerText?: string | undefined;
|
|
1447
|
+
attachments?: {
|
|
1448
|
+
type: string;
|
|
1449
|
+
url: string;
|
|
1450
|
+
previewUrl: string | null;
|
|
1451
|
+
textUrl: null;
|
|
1452
|
+
filename: string;
|
|
1453
|
+
meta: {
|
|
1454
|
+
usage?: string | undefined;
|
|
1455
|
+
focus?: {
|
|
1456
|
+
x: number;
|
|
1457
|
+
y: number;
|
|
1458
|
+
} | undefined;
|
|
1459
|
+
mimetype?: string | undefined;
|
|
1460
|
+
size?: number | undefined;
|
|
1461
|
+
};
|
|
1462
|
+
description?: string | undefined;
|
|
1463
|
+
blurhash?: string | undefined;
|
|
1464
|
+
status?: "ready" | "failed" | "processing" | undefined;
|
|
1465
|
+
error?: string | undefined;
|
|
1466
|
+
}[] | undefined;
|
|
1467
|
+
customEmojis?: {
|
|
1468
|
+
shortcode: string;
|
|
1469
|
+
url: string;
|
|
1470
|
+
staticUrl: string;
|
|
1471
|
+
visibleInPicker: boolean;
|
|
1472
|
+
category: string;
|
|
1473
|
+
}[] | undefined;
|
|
1474
|
+
language?: string | undefined;
|
|
1475
|
+
} | {
|
|
1476
|
+
type: "question";
|
|
1477
|
+
options: {
|
|
1478
|
+
content: string;
|
|
1479
|
+
type: "note";
|
|
1480
|
+
}[];
|
|
1481
|
+
content?: string | undefined;
|
|
1482
|
+
sensitive?: boolean | undefined;
|
|
1483
|
+
spoilerText?: string | undefined;
|
|
1484
|
+
attachments?: {
|
|
1485
|
+
type: string;
|
|
1486
|
+
url: string;
|
|
1487
|
+
previewUrl: string | null;
|
|
1488
|
+
textUrl: null;
|
|
1489
|
+
filename: string;
|
|
1490
|
+
meta: {
|
|
1491
|
+
usage?: string | undefined;
|
|
1492
|
+
focus?: {
|
|
1493
|
+
x: number;
|
|
1494
|
+
y: number;
|
|
1495
|
+
} | undefined;
|
|
1496
|
+
mimetype?: string | undefined;
|
|
1497
|
+
size?: number | undefined;
|
|
1498
|
+
};
|
|
1499
|
+
description?: string | undefined;
|
|
1500
|
+
blurhash?: string | undefined;
|
|
1501
|
+
status?: "ready" | "failed" | "processing" | undefined;
|
|
1502
|
+
error?: string | undefined;
|
|
1503
|
+
}[] | undefined;
|
|
1504
|
+
customEmojis?: {
|
|
1505
|
+
shortcode: string;
|
|
1506
|
+
url: string;
|
|
1507
|
+
staticUrl: string;
|
|
1508
|
+
visibleInPicker: boolean;
|
|
1509
|
+
category: string;
|
|
1510
|
+
}[] | undefined;
|
|
1511
|
+
language?: string | undefined;
|
|
1512
|
+
multiple?: boolean | undefined;
|
|
1513
|
+
votersVisible?: boolean | undefined;
|
|
1514
|
+
expiresAt?: string | undefined;
|
|
1515
|
+
} | {
|
|
1516
|
+
type: "event";
|
|
1517
|
+
start: string;
|
|
1518
|
+
wholeDay: boolean;
|
|
1519
|
+
content?: string | undefined;
|
|
1520
|
+
sensitive?: boolean | undefined;
|
|
1521
|
+
spoilerText?: string | undefined;
|
|
1522
|
+
attachments?: {
|
|
1523
|
+
type: string;
|
|
1524
|
+
url: string;
|
|
1525
|
+
previewUrl: string | null;
|
|
1526
|
+
textUrl: null;
|
|
1527
|
+
filename: string;
|
|
1528
|
+
meta: {
|
|
1529
|
+
usage?: string | undefined;
|
|
1530
|
+
focus?: {
|
|
1531
|
+
x: number;
|
|
1532
|
+
y: number;
|
|
1533
|
+
} | undefined;
|
|
1534
|
+
mimetype?: string | undefined;
|
|
1535
|
+
size?: number | undefined;
|
|
1536
|
+
};
|
|
1537
|
+
description?: string | undefined;
|
|
1538
|
+
blurhash?: string | undefined;
|
|
1539
|
+
status?: "ready" | "failed" | "processing" | undefined;
|
|
1540
|
+
error?: string | undefined;
|
|
1541
|
+
}[] | undefined;
|
|
1542
|
+
customEmojis?: {
|
|
1543
|
+
shortcode: string;
|
|
1544
|
+
url: string;
|
|
1545
|
+
staticUrl: string;
|
|
1546
|
+
visibleInPicker: boolean;
|
|
1547
|
+
category: string;
|
|
1548
|
+
}[] | undefined;
|
|
1549
|
+
language?: string | undefined;
|
|
1550
|
+
name?: string | undefined;
|
|
1551
|
+
timeZone?: string | undefined;
|
|
1552
|
+
image?: string | undefined;
|
|
1553
|
+
end?: string | undefined;
|
|
1554
|
+
maxAttendees?: number | undefined;
|
|
1555
|
+
attendeeListPublic?: boolean | undefined;
|
|
1556
|
+
moderators?: string[] | undefined;
|
|
1557
|
+
jam?: {
|
|
1558
|
+
moderators: string[];
|
|
1559
|
+
videoEnabled: boolean;
|
|
1560
|
+
type: "video-call";
|
|
1561
|
+
speakers?: string[] | undefined;
|
|
1562
|
+
presenters?: string[] | undefined;
|
|
1563
|
+
audience?: string[] | undefined;
|
|
1564
|
+
maxSpeakers?: number | undefined;
|
|
1565
|
+
maxPresenters?: number | undefined;
|
|
1566
|
+
maxAudience?: number | undefined;
|
|
1567
|
+
waitingRoom?: boolean | undefined;
|
|
1568
|
+
} | undefined;
|
|
1569
|
+
physicalLocation?: {
|
|
1570
|
+
text: string;
|
|
1571
|
+
coordinates?: {
|
|
1572
|
+
lat: number;
|
|
1573
|
+
lng: number;
|
|
1574
|
+
alt?: number | undefined;
|
|
1575
|
+
} | undefined;
|
|
1576
|
+
} | undefined;
|
|
1577
|
+
url?: string | undefined;
|
|
1578
|
+
recurrence?: {
|
|
1579
|
+
freq: "DAILY" | "WEEKLY" | "MONTHLY";
|
|
1580
|
+
interval?: number | undefined;
|
|
1581
|
+
byDay?: ("MO" | "TU" | "WE" | "TH" | "FR" | "SA" | "SU")[] | undefined;
|
|
1582
|
+
until?: string | undefined;
|
|
1583
|
+
count?: number | undefined;
|
|
1584
|
+
} | undefined;
|
|
1585
|
+
exceptions?: {
|
|
1586
|
+
recurrenceId: string;
|
|
1587
|
+
cancelled?: boolean | undefined;
|
|
1588
|
+
start?: string | undefined;
|
|
1589
|
+
end?: string | undefined;
|
|
1590
|
+
physicalLocation?: {
|
|
1591
|
+
text: string;
|
|
1592
|
+
coordinates?: {
|
|
1593
|
+
lat: number;
|
|
1594
|
+
lng: number;
|
|
1595
|
+
alt?: number | undefined;
|
|
1596
|
+
} | undefined;
|
|
1597
|
+
} | undefined;
|
|
1598
|
+
}[] | undefined;
|
|
1250
1599
|
} | {
|
|
1251
1600
|
type: "article";
|
|
1252
1601
|
content?: string | undefined;
|
|
@@ -1427,6 +1776,27 @@ export declare const postsMappingForProfile: (profile?: {
|
|
|
1427
1776
|
} | undefined;
|
|
1428
1777
|
} | undefined;
|
|
1429
1778
|
url?: string | undefined;
|
|
1779
|
+
recurrence?: {
|
|
1780
|
+
freq: "DAILY" | "WEEKLY" | "MONTHLY";
|
|
1781
|
+
interval?: number | undefined;
|
|
1782
|
+
byDay?: ("MO" | "TU" | "WE" | "TH" | "FR" | "SA" | "SU")[] | undefined;
|
|
1783
|
+
until?: string | undefined;
|
|
1784
|
+
count?: number | undefined;
|
|
1785
|
+
} | undefined;
|
|
1786
|
+
exceptions?: {
|
|
1787
|
+
recurrenceId: string;
|
|
1788
|
+
cancelled?: boolean | undefined;
|
|
1789
|
+
start?: string | undefined;
|
|
1790
|
+
end?: string | undefined;
|
|
1791
|
+
physicalLocation?: {
|
|
1792
|
+
text: string;
|
|
1793
|
+
coordinates?: {
|
|
1794
|
+
lat: number;
|
|
1795
|
+
lng: number;
|
|
1796
|
+
alt?: number | undefined;
|
|
1797
|
+
} | undefined;
|
|
1798
|
+
} | undefined;
|
|
1799
|
+
}[] | undefined;
|
|
1430
1800
|
} | {
|
|
1431
1801
|
type: "article";
|
|
1432
1802
|
content?: string | undefined;
|
|
@@ -1607,6 +1977,27 @@ export declare const postContextMappingForProfile: (profile?: {
|
|
|
1607
1977
|
} | undefined;
|
|
1608
1978
|
} | undefined;
|
|
1609
1979
|
url?: string | undefined;
|
|
1980
|
+
recurrence?: {
|
|
1981
|
+
freq: "DAILY" | "WEEKLY" | "MONTHLY";
|
|
1982
|
+
interval?: number | undefined;
|
|
1983
|
+
byDay?: ("MO" | "TU" | "WE" | "TH" | "FR" | "SA" | "SU")[] | undefined;
|
|
1984
|
+
until?: string | undefined;
|
|
1985
|
+
count?: number | undefined;
|
|
1986
|
+
} | undefined;
|
|
1987
|
+
exceptions?: {
|
|
1988
|
+
recurrenceId: string;
|
|
1989
|
+
cancelled?: boolean | undefined;
|
|
1990
|
+
start?: string | undefined;
|
|
1991
|
+
end?: string | undefined;
|
|
1992
|
+
physicalLocation?: {
|
|
1993
|
+
text: string;
|
|
1994
|
+
coordinates?: {
|
|
1995
|
+
lat: number;
|
|
1996
|
+
lng: number;
|
|
1997
|
+
alt?: number | undefined;
|
|
1998
|
+
} | undefined;
|
|
1999
|
+
} | undefined;
|
|
2000
|
+
}[] | undefined;
|
|
1610
2001
|
} | {
|
|
1611
2002
|
type: "article";
|
|
1612
2003
|
content?: string | undefined;
|
|
@@ -1786,6 +2177,27 @@ export declare const conversationLeavesMapping: Mapping<{
|
|
|
1786
2177
|
} | undefined;
|
|
1787
2178
|
} | undefined;
|
|
1788
2179
|
url?: string | undefined;
|
|
2180
|
+
recurrence?: {
|
|
2181
|
+
freq: "DAILY" | "WEEKLY" | "MONTHLY";
|
|
2182
|
+
interval?: number | undefined;
|
|
2183
|
+
byDay?: ("MO" | "TU" | "WE" | "TH" | "FR" | "SA" | "SU")[] | undefined;
|
|
2184
|
+
until?: string | undefined;
|
|
2185
|
+
count?: number | undefined;
|
|
2186
|
+
} | undefined;
|
|
2187
|
+
exceptions?: {
|
|
2188
|
+
recurrenceId: string;
|
|
2189
|
+
cancelled?: boolean | undefined;
|
|
2190
|
+
start?: string | undefined;
|
|
2191
|
+
end?: string | undefined;
|
|
2192
|
+
physicalLocation?: {
|
|
2193
|
+
text: string;
|
|
2194
|
+
coordinates?: {
|
|
2195
|
+
lat: number;
|
|
2196
|
+
lng: number;
|
|
2197
|
+
alt?: number | undefined;
|
|
2198
|
+
} | undefined;
|
|
2199
|
+
} | undefined;
|
|
2200
|
+
}[] | undefined;
|
|
1789
2201
|
} | {
|
|
1790
2202
|
type: "article";
|
|
1791
2203
|
content?: string | undefined;
|
|
@@ -1966,6 +2378,27 @@ export declare const conversationLeavesMappingForProfile: (profile?: {
|
|
|
1966
2378
|
} | undefined;
|
|
1967
2379
|
} | undefined;
|
|
1968
2380
|
url?: string | undefined;
|
|
2381
|
+
recurrence?: {
|
|
2382
|
+
freq: "DAILY" | "WEEKLY" | "MONTHLY";
|
|
2383
|
+
interval?: number | undefined;
|
|
2384
|
+
byDay?: ("MO" | "TU" | "WE" | "TH" | "FR" | "SA" | "SU")[] | undefined;
|
|
2385
|
+
until?: string | undefined;
|
|
2386
|
+
count?: number | undefined;
|
|
2387
|
+
} | undefined;
|
|
2388
|
+
exceptions?: {
|
|
2389
|
+
recurrenceId: string;
|
|
2390
|
+
cancelled?: boolean | undefined;
|
|
2391
|
+
start?: string | undefined;
|
|
2392
|
+
end?: string | undefined;
|
|
2393
|
+
physicalLocation?: {
|
|
2394
|
+
text: string;
|
|
2395
|
+
coordinates?: {
|
|
2396
|
+
lat: number;
|
|
2397
|
+
lng: number;
|
|
2398
|
+
alt?: number | undefined;
|
|
2399
|
+
} | undefined;
|
|
2400
|
+
} | undefined;
|
|
2401
|
+
}[] | undefined;
|
|
1969
2402
|
} | {
|
|
1970
2403
|
type: "article";
|
|
1971
2404
|
content?: string | undefined;
|
|
@@ -2144,6 +2577,27 @@ export declare const postIdsMapping: Mapping<{
|
|
|
2144
2577
|
} | undefined;
|
|
2145
2578
|
} | undefined;
|
|
2146
2579
|
url?: string | undefined;
|
|
2580
|
+
recurrence?: {
|
|
2581
|
+
freq: "DAILY" | "WEEKLY" | "MONTHLY";
|
|
2582
|
+
interval?: number | undefined;
|
|
2583
|
+
byDay?: ("MO" | "TU" | "WE" | "TH" | "FR" | "SA" | "SU")[] | undefined;
|
|
2584
|
+
until?: string | undefined;
|
|
2585
|
+
count?: number | undefined;
|
|
2586
|
+
} | undefined;
|
|
2587
|
+
exceptions?: {
|
|
2588
|
+
recurrenceId: string;
|
|
2589
|
+
cancelled?: boolean | undefined;
|
|
2590
|
+
start?: string | undefined;
|
|
2591
|
+
end?: string | undefined;
|
|
2592
|
+
physicalLocation?: {
|
|
2593
|
+
text: string;
|
|
2594
|
+
coordinates?: {
|
|
2595
|
+
lat: number;
|
|
2596
|
+
lng: number;
|
|
2597
|
+
alt?: number | undefined;
|
|
2598
|
+
} | undefined;
|
|
2599
|
+
} | undefined;
|
|
2600
|
+
}[] | undefined;
|
|
2147
2601
|
} | {
|
|
2148
2602
|
type: "article";
|
|
2149
2603
|
content?: string | undefined;
|
package/dist/posts/mapping.js
CHANGED
|
@@ -3,10 +3,6 @@ import { postFilters } from '../db/pg/filters/index.js';
|
|
|
3
3
|
import { postDerived } from '../db/pg/queries/index.js';
|
|
4
4
|
import { collectionInfos } from '../db/index.js';
|
|
5
5
|
import { groupsMapping } from '../groups/mapping.js';
|
|
6
|
-
const seenByCurrentProfileDerivedProperty = (profile) => ({
|
|
7
|
-
alias: 'seen',
|
|
8
|
-
resolve: postDerived.seen(profile === null || profile === void 0 ? void 0 : profile.id),
|
|
9
|
-
});
|
|
10
6
|
const seenBatchByCurrentProfileDerivedProperty = (profile) => postDerived.seenBatch(profile === null || profile === void 0 ? void 0 : profile.id);
|
|
11
7
|
export const entriesRelation = {
|
|
12
8
|
alias: 'entries',
|
|
@@ -63,6 +59,27 @@ const reactionsRelation = {
|
|
|
63
59
|
softDelete: true,
|
|
64
60
|
},
|
|
65
61
|
};
|
|
62
|
+
/** Cap for embedded who-reposted lists on feed/detail posts. */
|
|
63
|
+
export const EMBEDDED_REPOSTS_LIMIT = 50;
|
|
64
|
+
/**
|
|
65
|
+
* Lean inbound wrappers for the embedded `reposts` preview. Only loads create
|
|
66
|
+
* entries (for the reposter profile) — not the full post graph used by
|
|
67
|
+
* `repostsOfPostRelation`. Cap + newest-first sort keep hot posts bounded.
|
|
68
|
+
*/
|
|
69
|
+
const leanRepostsRelation = {
|
|
70
|
+
alias: 'reposts',
|
|
71
|
+
edgeCollection: 'repost',
|
|
72
|
+
direction: 'INBOUND',
|
|
73
|
+
skipEdge: true,
|
|
74
|
+
cardinality: 'many',
|
|
75
|
+
mapping: {
|
|
76
|
+
collection: 'posts',
|
|
77
|
+
softDelete: true,
|
|
78
|
+
limit: EMBEDDED_REPOSTS_LIMIT,
|
|
79
|
+
sort: [['createdAt', 'DESC']],
|
|
80
|
+
postFilterRelations: [entriesRelation],
|
|
81
|
+
},
|
|
82
|
+
};
|
|
66
83
|
const audienceRelation = {
|
|
67
84
|
alias: 'audience',
|
|
68
85
|
edgeCollection: 'audience',
|
|
@@ -99,6 +116,7 @@ const basePostFilterRelations = [
|
|
|
99
116
|
replyCountRelation,
|
|
100
117
|
repostCountRelation,
|
|
101
118
|
reactionsRelation,
|
|
119
|
+
leanRepostsRelation,
|
|
102
120
|
tagsRelation,
|
|
103
121
|
mentionsRelation,
|
|
104
122
|
];
|
|
@@ -118,9 +136,14 @@ const basePostMapData = Object.assign(Object.assign({}, preFilterMapData), { pos
|
|
|
118
136
|
] });
|
|
119
137
|
const basePostMapDataForProfile = (profile) => (Object.assign(Object.assign({}, basePostMapData), { postFilterDerivedProperties: [
|
|
120
138
|
...(basePostMapData.postFilterDerivedProperties || []),
|
|
121
|
-
|
|
139
|
+
seenBatchByCurrentProfileDerivedProperty(profile),
|
|
122
140
|
] }));
|
|
123
|
-
|
|
141
|
+
// Keep soft-deleted parents so replies can render a tombstone / deleted post.
|
|
142
|
+
const replyPostMapData = {
|
|
143
|
+
collection: 'posts',
|
|
144
|
+
softDelete: false,
|
|
145
|
+
postFilterRelations: [entriesRelation],
|
|
146
|
+
};
|
|
124
147
|
const replyToRelation = {
|
|
125
148
|
alias: 'replyTo',
|
|
126
149
|
edgeCollection: 'replyTo',
|
|
@@ -177,23 +200,32 @@ export const postsMapping = map(Object.assign(Object.assign({}, basePostMapData)
|
|
|
177
200
|
repostRelation,
|
|
178
201
|
replyToRelation,
|
|
179
202
|
] }));
|
|
203
|
+
/** Auth / mark-seen: post graph without nested replyTo/repost hydrate. */
|
|
204
|
+
export const postsAuthMapping = map(Object.assign(Object.assign({}, basePostMapData), { postFilterRelations: basePostFilterRelations }));
|
|
180
205
|
export const postsMappingForProfile = (profile) => map(Object.assign(Object.assign({}, basePostMapDataForProfile(profile)), { postFilterRelations: [
|
|
181
206
|
...basePostFilterRelations,
|
|
182
207
|
repostRelationForProfile(profile),
|
|
183
208
|
replyToRelation,
|
|
184
209
|
] }));
|
|
185
|
-
/** Lean mapping for post detail context — skips
|
|
210
|
+
/** Lean mapping for post detail context — skips nested repost. Audience is
|
|
211
|
+
* required so direct replies stay readable to the thread's recipients. */
|
|
186
212
|
const contextPostFilterRelations = [
|
|
187
213
|
entriesRelation,
|
|
214
|
+
audienceRelation,
|
|
188
215
|
groupRelation,
|
|
189
216
|
replyCountRelation,
|
|
190
217
|
repostCountRelation,
|
|
191
218
|
reactionsRelation,
|
|
219
|
+
leanRepostsRelation,
|
|
192
220
|
tagsRelation,
|
|
193
221
|
mentionsRelation,
|
|
194
222
|
replyToRelation,
|
|
195
223
|
];
|
|
196
|
-
export const postContextMappingForProfile = (profile) => map(
|
|
224
|
+
export const postContextMappingForProfile = (profile) => map({
|
|
225
|
+
collection: 'posts',
|
|
226
|
+
softDelete: false,
|
|
227
|
+
postFilterRelations: contextPostFilterRelations,
|
|
228
|
+
postFilterDerivedProperties: [
|
|
197
229
|
{
|
|
198
230
|
alias: 'inReplyToId',
|
|
199
231
|
resolve: postDerived.inReplyToId,
|
|
@@ -203,7 +235,9 @@ export const postContextMappingForProfile = (profile) => map(Object.assign(Objec
|
|
|
203
235
|
resolve: postDerived.groupId,
|
|
204
236
|
},
|
|
205
237
|
seenBatchByCurrentProfileDerivedProperty(profile),
|
|
206
|
-
],
|
|
238
|
+
],
|
|
239
|
+
limit: 100,
|
|
240
|
+
});
|
|
207
241
|
export const contextRelation = (depth, direction, contextMapping = postsMapping) => ({
|
|
208
242
|
alias: 'context',
|
|
209
243
|
edgeCollection: collectionInfos.repliesCollection.name,
|
|
@@ -11,9 +11,11 @@ export declare const reactToPost: (post: PostWithMeta, profile: Profile, data: R
|
|
|
11
11
|
export declare const retractReaction: (post: PostWithMeta, profile: Profile) => Promise<void>;
|
|
12
12
|
export declare const bookmarkPost: (post: PostWithMeta, profile: Profile) => Promise<void>;
|
|
13
13
|
export declare const unbookmarkPost: (post: PostWithMeta, profile: Profile) => Promise<void>;
|
|
14
|
-
export declare const markPostsSeen: (posts:
|
|
14
|
+
export declare const markPostsSeen: (posts: {
|
|
15
|
+
id: string;
|
|
16
|
+
}[], profile: Profile) => Promise<void>;
|
|
15
17
|
export declare const markGroupPostsSeen: (authData: AuthorizationData, groupId: string) => Promise<void>;
|
|
16
18
|
export declare const deletePost: (post: PostWithMeta, profile: Profile) => Promise<import("@openpeepshq/common").DbPost | undefined>;
|
|
17
19
|
export declare const vote: (profile: Profile, post: PostWithMeta, data: Answer) => Promise<void>;
|
|
18
20
|
export declare const rsvpRespond: (profile: Profile, post: PostWithMeta, data: RSVP) => Promise<void>;
|
|
19
|
-
export declare const rsvpManageByOrganizer: (actingProfile: Profile, targetProfile: Profile, post: PostWithMeta, response: Extract<RsvpResponse, "removed" | "yes"
|
|
21
|
+
export declare const rsvpManageByOrganizer: (actingProfile: Profile, targetProfile: Profile, post: PostWithMeta, response: Extract<RsvpResponse, "removed" | "yes">, recurrenceId?: string) => Promise<void>;
|