@openpeepshq/core 0.1.33 → 0.1.35
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/finders.js +5 -6
- package/dist/accessTokens/mutations.js +1 -1
- package/dist/accessTokens/tokens.js +8 -11
- package/dist/accounts/helpers.js +6 -2
- package/dist/accounts/mutations.js +36 -33
- package/dist/analytics/cache.js +3 -3
- package/dist/analytics/clicks.js +14 -22
- package/dist/analytics/compile.js +17 -12
- package/dist/analytics/dateRange.js +3 -5
- package/dist/analytics/jobs.js +3 -4
- package/dist/analytics/pdfReport.js +45 -61
- package/dist/analytics/privacy.js +1 -1
- package/dist/analytics/read.js +164 -140
- package/dist/analytics/report.d.ts +22 -1
- package/dist/analytics/report.js +2 -3
- package/dist/analytics/settings.js +3 -4
- package/dist/backups/index.js +82 -25
- package/dist/backups/metadata.d.ts +2 -3
- package/dist/backups/metadata.js +6 -2
- package/dist/config/db.js +2 -4
- package/dist/config/defaults/capabilities.js +13 -2
- package/dist/config/defaults/community.js +8 -3
- package/dist/config/defaults/core.d.ts +1 -1
- package/dist/config/defaults/core.js +16 -8
- package/dist/config/index.d.ts +22 -0
- package/dist/config/index.js +15 -11
- package/dist/db/explorer/query.js +9 -8
- package/dist/db/explorer/sql.js +8 -8
- package/dist/db/helpers.d.ts +1 -0
- package/dist/db/helpers.js +25 -7
- package/dist/db/index.d.ts +1 -1
- package/dist/db/index.js +1 -0
- package/dist/db/init.js +2 -3
- package/dist/db/migration/importCollections.d.ts +14 -9
- package/dist/db/migration/importCollections.js +121 -174
- package/dist/db/migration/shared.d.ts +2 -33
- package/dist/db/migration/shared.js +17 -87
- package/dist/db/pg/client.js +4 -7
- package/dist/db/pg/collections.d.ts +2 -2
- package/dist/db/pg/collections.js +2 -2
- package/dist/db/pg/filters/index.js +1 -1
- package/dist/db/pg/filters/posts.d.ts +12 -0
- package/dist/db/pg/filters/posts.js +30 -4
- package/dist/db/pg/filters/profiles.d.ts +1 -0
- package/dist/db/pg/filters/profiles.js +2 -1
- package/dist/db/pg/helpers.js +2 -14
- package/dist/db/pg/map/filters.js +40 -10
- package/dist/db/pg/map/helpers.js +5 -1
- package/dist/db/pg/map/index.js +46 -51
- package/dist/db/pg/map/mutations.js +65 -25
- package/dist/db/pg/map/registry.d.ts +5 -0
- package/dist/db/pg/map/registry.js +133 -56
- package/dist/db/pg/map/relations.js +76 -68
- package/dist/db/pg/map/search.js +15 -37
- package/dist/db/pg/mappers.js +13 -7
- package/dist/db/pg/migrate.d.ts +1 -2
- package/dist/db/pg/migrate.js +8 -9
- package/dist/db/pg/queries/activity.js +5 -5
- package/dist/db/pg/queries/derived.js +8 -12
- package/dist/db/pg/queries/sorts.d.ts +1 -0
- package/dist/db/pg/queries/sorts.js +4 -0
- package/dist/db/pg/schema/documents.d.ts +279 -41
- package/dist/db/pg/schema/documents.js +136 -22
- package/dist/db/pg/schema/edges.d.ts +116 -7
- package/dist/db/pg/schema/edges.js +9 -2
- package/dist/db/pg/schema/index.d.ts +362 -15
- package/dist/db/pg/schema/index.js +5 -1
- package/dist/db/pg/sql/0010_user_group_membership_roles.sql +16 -0
- package/dist/db/pg/sql/0011_drop_data_migrations.sql +1 -0
- package/dist/db/pg/sql/0012_posts_last_activity_at.sql +5 -0
- package/dist/db/pg/sql/0013_add_blocks_edge.sql +12 -0
- package/dist/db/pg/sql/0014_federation_datamodel.sql +59 -0
- package/dist/db/pg/sql/0015_profile_hashtags.sql +12 -0
- package/dist/db/pg/sql/0016_posts_search_vector_title_tags_path.sql +54 -0
- package/dist/db/pg/sql/meta/{0009_snapshot.json → 0015_snapshot.json} +291 -36
- package/dist/db/pg/sql/meta/_journal.json +49 -0
- package/dist/db/replaceOrigin.js +1 -1
- package/dist/email/queueStats.js +8 -11
- package/dist/email/render.js +14 -3
- package/dist/email/send.js +19 -17
- package/dist/email/smtpTest.js +10 -6
- package/dist/errors/index.js +1 -1
- package/dist/events/index.d.ts +4 -0
- package/dist/events/index.js +1 -0
- package/dist/events/once.js +2 -4
- package/dist/federation/activities.d.ts +17 -0
- package/dist/federation/activities.js +25 -0
- package/dist/federation/identity.d.ts +16 -0
- package/dist/federation/identity.js +52 -0
- package/dist/federation/index.d.ts +4 -0
- package/dist/federation/index.js +3 -0
- package/dist/federation/profiles.d.ts +3 -0
- package/dist/federation/profiles.js +14 -0
- package/dist/groups/finders.d.ts +2 -1
- package/dist/groups/helpers.d.ts +18 -0
- package/dist/groups/helpers.js +1 -2
- package/dist/groups/mapping.d.ts +4 -2
- package/dist/groups/mutations.js +1 -1
- package/dist/hashtags/finders.d.ts +6 -3
- package/dist/hashtags/finders.js +2 -0
- package/dist/hashtags/helpers.d.ts +8 -0
- package/dist/hashtags/helpers.js +4 -0
- package/dist/hashtags/index.d.ts +2 -0
- package/dist/hashtags/index.js +2 -0
- package/dist/hashtags/mutations.d.ts +3 -0
- package/dist/hashtags/mutations.js +13 -1
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/index.js +3 -1
- package/dist/i18n/pluginLocales.d.ts +6 -0
- package/dist/i18n/pluginLocales.js +15 -0
- package/dist/inviteLinks/mutations.js +2 -3
- package/dist/jams/export.d.ts +19 -0
- package/dist/jams/export.js +58 -0
- package/dist/jams/finders.js +4 -1
- package/dist/jams/health.d.ts +10 -0
- package/dist/jams/health.js +50 -0
- package/dist/jams/helpers.d.ts +2 -2
- package/dist/jams/helpers.js +6 -2
- package/dist/jams/index.d.ts +2 -0
- package/dist/jams/index.js +25 -18
- package/dist/jams/jobs.js +2 -3
- package/dist/jams/livekit.d.ts +49 -4
- package/dist/jams/livekit.js +62 -45
- package/dist/jams/mapping.d.ts +3 -3
- package/dist/jams/mutations.d.ts +1 -1
- package/dist/jams/recording.d.ts +10 -0
- package/dist/jams/recording.js +33 -1
- package/dist/jams/token.d.ts +13 -1
- package/dist/jams/token.js +25 -18
- package/dist/jams/waitingRoom.js +1 -1
- package/dist/jobs/index.d.ts +1 -0
- package/dist/jobs/index.js +9 -3
- package/dist/jobs/jobDetail.js +6 -12
- package/dist/jobs/jobLog.js +2 -3
- package/dist/lib/streams.js +4 -39
- package/dist/lib/zodDeepPartial.d.ts +1 -1
- package/dist/lib/zodDeepPartial.js +1 -1
- package/dist/log/index.js +13 -29
- package/dist/media/index.d.ts +1 -1
- package/dist/media/index.js +73 -12
- package/dist/media/jobs.js +1 -2
- package/dist/media/openpeeps/index.js +11 -46
- package/dist/media/processing.js +25 -11
- package/dist/media/streaming.js +5 -5
- package/dist/media/streamingCleanupJobs.js +1 -2
- package/dist/media/streamingJobs.js +3 -4
- package/dist/media/streamingPrewarm.js +7 -11
- package/dist/mediaAttachments/index.js +6 -2
- package/dist/notifications/defaultNotifications/announcement/index.js +15 -18
- package/dist/notifications/defaultNotifications/directMessage/index.js +9 -8
- package/dist/notifications/defaultNotifications/follow/index.js +15 -18
- package/dist/notifications/defaultNotifications/groupAdded/index.js +14 -17
- package/dist/notifications/defaultNotifications/groupMemberJoined/index.js +15 -18
- package/dist/notifications/defaultNotifications/groupMemberLeft/index.js +15 -18
- package/dist/notifications/defaultNotifications/index.js +4 -0
- package/dist/notifications/defaultNotifications/jamModerator/index.js +3 -5
- package/dist/notifications/defaultNotifications/jamSpeaker/index.js +14 -18
- package/dist/notifications/defaultNotifications/jamStarted/index.js +18 -22
- package/dist/notifications/defaultNotifications/mention/index.js +20 -24
- package/dist/notifications/defaultNotifications/newGroupPost/index.js +11 -6
- package/dist/notifications/defaultNotifications/newProfile/index.js +14 -17
- package/dist/notifications/defaultNotifications/pollEnded/index.d.ts +19 -0
- package/dist/notifications/defaultNotifications/pollEnded/index.js +39 -0
- package/dist/notifications/defaultNotifications/pollEnded/recipients.d.ts +3 -0
- package/dist/notifications/defaultNotifications/pollEnded/recipients.js +17 -0
- package/dist/notifications/defaultNotifications/pollVote/index.js +14 -17
- package/dist/notifications/defaultNotifications/reaction/index.js +18 -21
- package/dist/notifications/defaultNotifications/reply/index.js +21 -22
- package/dist/notifications/defaultNotifications/repost/index.js +16 -20
- package/dist/notifications/defaultNotifications/rsvp/index.d.ts +6 -1
- package/dist/notifications/defaultNotifications/rsvp/index.js +31 -18
- package/dist/notifications/defaultNotifications/rsvpCanceled/index.d.ts +24 -0
- package/dist/notifications/defaultNotifications/rsvpCanceled/index.js +82 -0
- package/dist/notifications/defaultNotifications/rsvpCanceled/recipients.d.ts +4 -0
- package/dist/notifications/defaultNotifications/rsvpCanceled/recipients.js +11 -0
- package/dist/notifications/fcmCredential.js +1 -1
- package/dist/notifications/finders.js +1 -1
- package/dist/notifications/helpers.js +13 -10
- package/dist/notifications/jobs.js +10 -5
- package/dist/notifications/mutations.js +8 -1
- package/dist/notifications/push.js +11 -16
- package/dist/performance/index.js +3 -3
- package/dist/plugins/helpers.js +3 -6
- package/dist/plugins/index.js +39 -4
- package/dist/plugins/install.d.ts +28 -9
- package/dist/plugins/install.js +302 -56
- package/dist/plugins/pluginAuth.d.ts +1 -1
- package/dist/plugins/pluginAuth.js +13 -10
- package/dist/plugins/state.js +2 -3
- package/dist/posts/activity.d.ts +9 -0
- package/dist/posts/activity.js +34 -0
- package/dist/posts/contextClosure.d.ts +1 -9
- package/dist/posts/contextClosure.js +14 -44
- package/dist/posts/conversationQueries.d.ts +7 -0
- package/dist/posts/conversationQueries.js +76 -4
- package/dist/posts/eventAgenda.d.ts +1 -0
- package/dist/posts/eventAgenda.js +17 -8
- package/dist/posts/eventOccurrenceJobs.js +7 -2
- package/dist/posts/eventOccurrences.d.ts +6 -0
- package/dist/posts/eventOccurrences.js +22 -1
- package/dist/posts/finders.d.ts +56 -9
- package/dist/posts/finders.js +84 -23
- package/dist/posts/helpers/filters.js +13 -9
- package/dist/posts/helpers/index.d.ts +179 -14
- package/dist/posts/helpers/index.js +70 -34
- package/dist/posts/index.d.ts +5 -2
- package/dist/posts/index.js +5 -2
- package/dist/posts/mapping.d.ts +765 -30
- package/dist/posts/mapping.js +74 -31
- package/dist/posts/mutations.d.ts +516 -3
- package/dist/posts/mutations.js +179 -41
- package/dist/posts/pollEnd.d.ts +3 -0
- package/dist/posts/pollEnd.js +4 -0
- package/dist/posts/pollEndJobs.d.ts +8 -0
- package/dist/posts/pollEndJobs.js +49 -0
- package/dist/posts/replyClosure.d.ts +10 -0
- package/dist/posts/replyClosure.js +43 -0
- package/dist/posts/rsvpConfirmationEmail.js +23 -15
- package/dist/posts/threadPreview.d.ts +8 -0
- package/dist/posts/threadPreview.js +44 -0
- package/dist/posts/unseenCounts.js +4 -1
- package/dist/processingStats/queries.js +6 -7
- package/dist/profileSettings/cache.js +21 -5
- package/dist/profileSettings/mapping.d.ts +2 -0
- package/dist/profiles/activityQueries.d.ts +5 -0
- package/dist/profiles/activityQueries.js +85 -0
- package/dist/profiles/activitySummary.d.ts +3 -0
- package/dist/profiles/activitySummary.js +82 -0
- package/dist/profiles/blocks.d.ts +12 -0
- package/dist/profiles/blocks.js +73 -0
- package/dist/profiles/cache.d.ts +1 -0
- package/dist/profiles/cache.js +30 -10
- package/dist/profiles/export.js +30 -39
- package/dist/profiles/finders.d.ts +2 -1
- package/dist/profiles/finders.js +15 -8
- package/dist/profiles/helpers.d.ts +2 -0
- package/dist/profiles/index.d.ts +2 -0
- package/dist/profiles/index.js +2 -0
- package/dist/profiles/mapping.d.ts +10 -5
- package/dist/profiles/mapping.js +13 -1
- package/dist/profiles/mutations.d.ts +8 -4
- package/dist/profiles/mutations.js +31 -4
- package/dist/redis/connection.d.ts +2 -0
- package/dist/redis/connection.js +25 -6
- package/dist/reports/helpers.js +7 -3
- package/dist/roles/index.d.ts +1 -1
- package/dist/roles/index.js +1 -1
- package/dist/roles/mapping.d.ts +1 -0
- package/dist/roles/mutations.js +85 -3
- package/dist/search/finders.js +15 -3
- package/dist/search/helpers.js +1 -1
- package/dist/search/mapping.d.ts +1 -1
- package/dist/search/mapping.js +6 -2
- package/dist/sentry/index.js +9 -11
- package/dist/seo/index.d.ts +50 -0
- package/dist/seo/index.js +145 -0
- package/dist/seo/route.d.ts +18 -0
- package/dist/seo/route.js +19 -0
- package/dist/server/index.d.ts +19 -0
- package/dist/server/index.js +31 -14
- package/dist/server/stablePublicServerInfo.d.ts +17 -0
- package/dist/server/stablePublicServerInfo.js +37 -0
- package/dist/server/status.d.ts +25 -0
- package/dist/server/status.js +97 -0
- package/dist/session/index.js +2 -2
- package/dist/stats/finders.d.ts +1 -17681
- package/dist/stats/finders.js +22 -9
- package/dist/stats/helpers.js +4 -1
- package/dist/stats/mapping.d.ts +39 -2
- package/dist/stats/mapping.js +8 -4
- package/dist/stripe/cache.js +5 -6
- package/dist/stripe/connection.js +3 -4
- package/dist/stripe/helpers.js +15 -20
- package/package.json +5 -7
- package/dist/db/migration/detect.d.ts +0 -3
- package/dist/db/migration/detect.js +0 -33
- package/dist/db/migration/importPostgres.d.ts +0 -3
- package/dist/db/migration/importPostgres.js +0 -18
- package/dist/db/migration/transform.d.ts +0 -20
- package/dist/db/migration/transform.js +0 -232
- package/dist/db/migration/validate.d.ts +0 -18
- package/dist/db/migration/validate.js +0 -69
- package/dist/db/pg/sql/meta/0000_snapshot.json +0 -3380
- package/dist/db/pg/sql/meta/0004_snapshot.json +0 -4114
- package/dist/db/pg/sql/meta/0005_snapshot.json +0 -4179
- package/dist/db/pg/sql/meta/0006_snapshot.json +0 -4200
- package/dist/db/pg/sql/meta/0007_snapshot.json +0 -4179
- package/dist/mastodon/index.d.ts +0 -4
- package/dist/mastodon/index.js +0 -51
- package/dist/mastodon/types.d.ts +0 -7579
- package/dist/mastodon/types.js +0 -523
- package/dist/mastodon/typescript.d.ts +0 -1578
- package/dist/mastodon/typescript.js +0 -1
- package/dist/migration/index.d.ts +0 -4
- package/dist/migration/index.js +0 -4
- package/dist/roles/defaults.d.ts +0 -2
- package/dist/roles/defaults.js +0 -95
package/dist/posts/mapping.js
CHANGED
|
@@ -3,7 +3,7 @@ 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 seenBatchByCurrentProfileDerivedProperty = (profile) => postDerived.seenBatch(profile
|
|
6
|
+
const seenBatchByCurrentProfileDerivedProperty = (profile) => postDerived.seenBatch(profile?.id);
|
|
7
7
|
export const entriesRelation = {
|
|
8
8
|
alias: 'entries',
|
|
9
9
|
edgeCollection: 'entries',
|
|
@@ -48,19 +48,10 @@ const repostCountRelation = {
|
|
|
48
48
|
softDelete: true,
|
|
49
49
|
},
|
|
50
50
|
};
|
|
51
|
-
const reactionsRelation = {
|
|
52
|
-
alias: 'reactions',
|
|
53
|
-
vertexAlias: 'profile',
|
|
54
|
-
edgeCollection: 'reactions',
|
|
55
|
-
direction: 'INBOUND',
|
|
56
|
-
cardinality: 'many',
|
|
57
|
-
mapping: {
|
|
58
|
-
collection: 'profiles',
|
|
59
|
-
softDelete: true,
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
51
|
/** Cap for embedded who-reposted lists on feed/detail posts. */
|
|
63
52
|
export const EMBEDDED_REPOSTS_LIMIT = 50;
|
|
53
|
+
/** Newest conversation descendants shown under a feed original. */
|
|
54
|
+
export const EMBEDDED_LATEST_REPLIES_LIMIT = 3;
|
|
64
55
|
/**
|
|
65
56
|
* Lean inbound wrappers for the embedded `reposts` preview. Only loads create
|
|
66
57
|
* entries (for the reposter profile) — not the full post graph used by
|
|
@@ -115,7 +106,6 @@ const basePostFilterRelations = [
|
|
|
115
106
|
groupRelation,
|
|
116
107
|
replyCountRelation,
|
|
117
108
|
repostCountRelation,
|
|
118
|
-
reactionsRelation,
|
|
119
109
|
leanRepostsRelation,
|
|
120
110
|
tagsRelation,
|
|
121
111
|
mentionsRelation,
|
|
@@ -124,7 +114,10 @@ const preFilterMapData = {
|
|
|
124
114
|
collection: 'posts',
|
|
125
115
|
softDelete: true,
|
|
126
116
|
};
|
|
127
|
-
const basePostMapData =
|
|
117
|
+
const basePostMapData = {
|
|
118
|
+
...preFilterMapData,
|
|
119
|
+
postFilterRelations: basePostFilterRelations,
|
|
120
|
+
postFilterDerivedProperties: [
|
|
128
121
|
{
|
|
129
122
|
alias: 'inReplyToId',
|
|
130
123
|
resolve: postDerived.inReplyToId,
|
|
@@ -133,11 +126,15 @@ const basePostMapData = Object.assign(Object.assign({}, preFilterMapData), { pos
|
|
|
133
126
|
alias: 'groupId',
|
|
134
127
|
resolve: postDerived.groupId,
|
|
135
128
|
},
|
|
136
|
-
]
|
|
137
|
-
|
|
129
|
+
],
|
|
130
|
+
};
|
|
131
|
+
const basePostMapDataForProfile = (profile) => ({
|
|
132
|
+
...basePostMapData,
|
|
133
|
+
postFilterDerivedProperties: [
|
|
138
134
|
...(basePostMapData.postFilterDerivedProperties || []),
|
|
139
135
|
seenBatchByCurrentProfileDerivedProperty(profile),
|
|
140
|
-
]
|
|
136
|
+
],
|
|
137
|
+
});
|
|
141
138
|
// Keep soft-deleted parents so replies can render a tombstone / deleted post.
|
|
142
139
|
const replyPostMapData = {
|
|
143
140
|
collection: 'posts',
|
|
@@ -152,32 +149,62 @@ const replyToRelation = {
|
|
|
152
149
|
cardinality: 'one',
|
|
153
150
|
mapping: replyPostMapData,
|
|
154
151
|
};
|
|
152
|
+
export const threadPreviewMappingForProfile = (profile) => map({
|
|
153
|
+
collection: 'posts',
|
|
154
|
+
softDelete: true,
|
|
155
|
+
postFilterRelations: [entriesRelation],
|
|
156
|
+
postFilterDerivedProperties: [
|
|
157
|
+
{
|
|
158
|
+
alias: 'inReplyToId',
|
|
159
|
+
resolve: postDerived.inReplyToId,
|
|
160
|
+
},
|
|
161
|
+
...(profile ? [seenBatchByCurrentProfileDerivedProperty(profile)] : []),
|
|
162
|
+
],
|
|
163
|
+
});
|
|
155
164
|
export const repostRelation = {
|
|
156
165
|
alias: 'repost',
|
|
157
166
|
edgeCollection: 'repost',
|
|
158
167
|
direction: 'OUTBOUND',
|
|
159
168
|
skipEdge: true,
|
|
160
169
|
cardinality: 'one',
|
|
161
|
-
mapping:
|
|
170
|
+
mapping: {
|
|
171
|
+
...basePostMapData,
|
|
172
|
+
postFilterRelations: [...basePostFilterRelations, replyToRelation],
|
|
173
|
+
},
|
|
162
174
|
};
|
|
163
|
-
export const repostRelationForProfile = (profile) => (
|
|
175
|
+
export const repostRelationForProfile = (profile) => ({
|
|
176
|
+
...repostRelation,
|
|
177
|
+
mapping: {
|
|
178
|
+
...basePostMapDataForProfile(profile),
|
|
179
|
+
postFilterRelations: [...basePostFilterRelations, replyToRelation],
|
|
180
|
+
},
|
|
181
|
+
});
|
|
164
182
|
export const repostsOfPostRelation = {
|
|
165
183
|
alias: 'reposts',
|
|
166
184
|
edgeCollection: 'repost',
|
|
167
185
|
direction: 'INBOUND',
|
|
168
186
|
skipEdge: true,
|
|
169
187
|
cardinality: 'many',
|
|
170
|
-
mapping:
|
|
188
|
+
mapping: {
|
|
189
|
+
...basePostMapData,
|
|
190
|
+
postFilterRelations: [
|
|
171
191
|
...basePostFilterRelations,
|
|
172
192
|
repostRelation,
|
|
173
193
|
replyToRelation,
|
|
174
|
-
]
|
|
194
|
+
],
|
|
195
|
+
},
|
|
175
196
|
};
|
|
176
|
-
export const repostsOfPostRelationForProfile = (profile) => (
|
|
197
|
+
export const repostsOfPostRelationForProfile = (profile) => ({
|
|
198
|
+
...repostsOfPostRelation,
|
|
199
|
+
mapping: {
|
|
200
|
+
...basePostMapDataForProfile(profile),
|
|
201
|
+
postFilterRelations: [
|
|
177
202
|
...basePostFilterRelations,
|
|
178
203
|
repostRelationForProfile(profile),
|
|
179
204
|
replyToRelation,
|
|
180
|
-
]
|
|
205
|
+
],
|
|
206
|
+
},
|
|
207
|
+
});
|
|
181
208
|
export const postsWithReplyCountMapping = map({
|
|
182
209
|
collection: 'posts',
|
|
183
210
|
relations: [replyCountRelation],
|
|
@@ -195,18 +222,27 @@ export const postsWithReplyToCountMapping = map({
|
|
|
195
222
|
},
|
|
196
223
|
],
|
|
197
224
|
});
|
|
198
|
-
export const postsMapping = map(
|
|
225
|
+
export const postsMapping = map({
|
|
226
|
+
...basePostMapData,
|
|
227
|
+
postFilterRelations: [
|
|
199
228
|
...basePostFilterRelations,
|
|
200
229
|
repostRelation,
|
|
201
230
|
replyToRelation,
|
|
202
|
-
]
|
|
231
|
+
],
|
|
232
|
+
});
|
|
203
233
|
/** Auth / mark-seen: post graph without nested replyTo/repost hydrate. */
|
|
204
|
-
export const postsAuthMapping = map(
|
|
205
|
-
|
|
234
|
+
export const postsAuthMapping = map({
|
|
235
|
+
...basePostMapData,
|
|
236
|
+
postFilterRelations: basePostFilterRelations,
|
|
237
|
+
});
|
|
238
|
+
export const postsMappingForProfile = (profile) => map({
|
|
239
|
+
...basePostMapDataForProfile(profile),
|
|
240
|
+
postFilterRelations: [
|
|
206
241
|
...basePostFilterRelations,
|
|
207
242
|
repostRelationForProfile(profile),
|
|
208
243
|
replyToRelation,
|
|
209
|
-
]
|
|
244
|
+
],
|
|
245
|
+
});
|
|
210
246
|
/** Lean mapping for post detail context — skips nested repost. Audience is
|
|
211
247
|
* required so direct replies stay readable to the thread's recipients. */
|
|
212
248
|
const contextPostFilterRelations = [
|
|
@@ -215,7 +251,6 @@ const contextPostFilterRelations = [
|
|
|
215
251
|
groupRelation,
|
|
216
252
|
replyCountRelation,
|
|
217
253
|
repostCountRelation,
|
|
218
|
-
reactionsRelation,
|
|
219
254
|
leanRepostsRelation,
|
|
220
255
|
tagsRelation,
|
|
221
256
|
mentionsRelation,
|
|
@@ -251,6 +286,14 @@ const conversationLeafFilters = [
|
|
|
251
286
|
postFilters.replyCountZero(),
|
|
252
287
|
postFilters.isDirect(),
|
|
253
288
|
];
|
|
254
|
-
export const conversationLeavesMapping = map(
|
|
255
|
-
|
|
289
|
+
export const conversationLeavesMapping = map({
|
|
290
|
+
...basePostMapData,
|
|
291
|
+
relations: [replyCountRelation],
|
|
292
|
+
filters: conversationLeafFilters,
|
|
293
|
+
});
|
|
294
|
+
export const conversationLeavesMappingForProfile = (profile) => map({
|
|
295
|
+
...basePostMapDataForProfile(profile),
|
|
296
|
+
relations: [replyCountRelation],
|
|
297
|
+
filters: conversationLeafFilters,
|
|
298
|
+
});
|
|
256
299
|
export const postIdsMapping = map(preFilterMapData);
|