[READ ONLY MIRROR] Spark Social AppView Server github.com/sprksocial/server
atproto deno hono lexicon
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

add cid to ingester models

+32 -8
+17 -1
services/ingester/src/db/models.ts
··· 8 8 authorHandle: string 9 9 createdAt: string 10 10 indexedAt: string 11 + cid: string 11 12 } 12 13 13 14 export const likeSchema = new Schema<LikeDocument>({ ··· 18 19 authorHandle: { type: String, required: true }, 19 20 createdAt: { type: String, required: true }, 20 21 indexedAt: { type: String, required: true }, 22 + cid: { type: String, required: true }, 21 23 }) 22 24 23 25 export interface FollowDocument extends Document { ··· 27 29 authorHandle: string 28 30 createdAt: string 29 31 indexedAt: string 32 + cid: string 30 33 } 31 34 32 35 export const followSchema = new Schema<FollowDocument>({ ··· 36 39 authorHandle: { type: String, required: true }, 37 40 createdAt: { type: String, required: true }, 38 41 indexedAt: { type: String, required: true }, 42 + cid: { type: String, required: true }, 39 43 }) 40 44 41 45 export interface BlockDocument extends Document { ··· 45 49 authorHandle: string 46 50 createdAt: string 47 51 indexedAt: string 52 + cid: string 48 53 } 49 54 50 55 export const blockSchema = new Schema<BlockDocument>({ ··· 54 59 authorHandle: { type: String, required: true }, 55 60 createdAt: { type: String, required: true }, 56 61 indexedAt: { type: String, required: true }, 62 + cid: { type: String, required: true }, 57 63 }) 58 64 59 65 export interface ProfileDocument extends Document { ··· 69 75 authorHandle: string 70 76 createdAt: string 71 77 indexedAt: string 78 + cid: string 72 79 } 73 80 74 81 export const profileSchema = new Schema<ProfileDocument>({ ··· 84 91 authorHandle: { type: String, required: true }, 85 92 createdAt: { type: String, required: true }, 86 93 indexedAt: { type: String, required: true }, 94 + cid: { type: String, required: true }, 87 95 }) 88 96 89 97 export interface AudioDocument extends Document { ··· 100 108 authorHandle: string 101 109 createdAt: string 102 110 indexedAt: string 111 + cid: string 103 112 } 104 113 105 114 export const audioSchema = new Schema<AudioDocument>({ ··· 116 125 authorHandle: { type: String, required: true }, 117 126 createdAt: { type: String, required: true }, 118 127 indexedAt: { type: String, required: true }, 128 + cid: { type: String, required: true }, 119 129 }) 120 130 121 131 export interface RepostDocument extends Document { ··· 128 138 authorHandle: string 129 139 createdAt: string 130 140 indexedAt: string 141 + cid: string 131 142 } 132 143 133 144 export const repostSchema = new Schema<RepostDocument>({ ··· 140 151 authorHandle: { type: String, required: true }, 141 152 createdAt: { type: String, required: true }, 142 153 indexedAt: { type: String, required: true }, 154 + cid: { type: String, required: true }, 143 155 }) 144 156 145 157 export interface MusicDocument extends Document { ··· 160 172 authorHandle: string 161 173 createdAt: string 162 174 indexedAt: string 175 + cid: string 163 176 } 164 177 165 178 export const musicSchema = new Schema<MusicDocument>({ ··· 180 193 authorHandle: { type: String, required: true }, 181 194 createdAt: { type: String, required: true }, 182 195 indexedAt: { type: String, required: true }, 196 + cid: { type: String, required: true }, 183 197 }) 184 198 185 199 export interface PostDocument extends Document { ··· 208 222 authorHandle: string 209 223 createdAt: string 210 224 indexedAt: string 225 + cid: string 211 226 } 212 227 213 228 export const postSchema = new Schema<PostDocument>({ ··· 243 258 authorDid: { type: String, required: true, index: true }, 244 259 authorHandle: { type: String, required: true }, 245 260 createdAt: { type: String, required: true }, 246 - indexedAt: { type: String, required: true } 261 + indexedAt: { type: String, required: true }, 262 + cid: { type: String, required: true }, 247 263 }) 248 264 249 265 // Add compound indexes for more efficient queries
+2 -1
services/ingester/src/handlers/audio-handler.ts
··· 50 50 authorDid: evt.did, 51 51 authorHandle: evt.handle || 'unknown', 52 52 createdAt: record.createdAt, 53 - indexedAt: now.toISOString() 53 + indexedAt: now.toISOString(), 54 + cid: evt.commit.cid 54 55 } 55 56 56 57 await db.models.Audio.findOneAndUpdate(
+2 -1
services/ingester/src/handlers/block-handler.ts
··· 43 43 authorDid: evt.did, 44 44 authorHandle: evt.handle || 'unknown', 45 45 createdAt: record.createdAt, 46 - indexedAt: now.toISOString() 46 + indexedAt: now.toISOString(), 47 + cid: evt.commit.cid 47 48 } 48 49 49 50 await db.models.Block.findOneAndUpdate(
+2 -1
services/ingester/src/handlers/follow-handler.ts
··· 43 43 authorDid: evt.did, 44 44 authorHandle: evt.handle || 'unknown', 45 45 createdAt: record.createdAt, 46 - indexedAt: now.toISOString() 46 + indexedAt: now.toISOString(), 47 + cid: evt.commit.cid 47 48 } 48 49 49 50 await db.models.Follow.findOneAndUpdate(
+1
services/ingester/src/handlers/like-handler.ts
··· 47 47 authorHandle: evt.handle || 'unknown', 48 48 createdAt: record.createdAt || now.toISOString(), 49 49 indexedAt: now.toISOString(), 50 + cid: evt.commit.cid, 50 51 }, 51 52 { upsert: true, new: true }, 52 53 )
+2 -1
services/ingester/src/handlers/music-handler.ts
··· 54 54 authorDid: evt.did, 55 55 authorHandle: evt.handle || 'unknown', 56 56 createdAt: record.createdAt, 57 - indexedAt: now.toISOString() 57 + indexedAt: now.toISOString(), 58 + cid: evt.commit.cid 58 59 } 59 60 60 61 await db.models.Music.findOneAndUpdate(
+2 -1
services/ingester/src/handlers/post-handler.ts
··· 48 48 authorDid: evt.did, 49 49 authorHandle: evt.handle || 'unknown', 50 50 createdAt: record.createdAt, 51 - indexedAt: now.toISOString() 51 + indexedAt: now.toISOString(), 52 + cid: evt.commit.cid 52 53 } 53 54 54 55 // Create or update the post record
+2 -1
services/ingester/src/handlers/profile-handler.ts
··· 49 49 authorDid: evt.did, 50 50 authorHandle: evt.handle || 'unknown', 51 51 createdAt: record.createdAt, 52 - indexedAt: now.toISOString() 52 + indexedAt: now.toISOString(), 53 + cid: evt.commit.cid 53 54 } 54 55 55 56 await db.models.Profile.findOneAndUpdate(
+2 -1
services/ingester/src/handlers/repost-handler.ts
··· 46 46 authorDid: evt.did, 47 47 authorHandle: evt.handle || 'unknown', 48 48 createdAt: record.createdAt, 49 - indexedAt: now.toISOString() 49 + indexedAt: now.toISOString(), 50 + cid: evt.commit.cid 50 51 } 51 52 52 53 await db.models.Repost.findOneAndUpdate(