This repository has no description
0

Configure Feed

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

remove removedBy and reason properties from lexicon record schema (unecessary)

+4 -42
+2 -13
src/modules/atproto/infrastructure/lexicon/lexicons.ts
··· 269 269 main: { 270 270 type: 'record', 271 271 description: 272 - "A record representing the removal of a collection link by a collection owner when they cannot delete the original link (which exists in another user's repository).", 272 + "A record representing the removal of a collection link by a collection owner when they cannot delete the original link (which exists in another user's repository). The creator of this record (determined from the AT-URI) is the user who performed the removal.", 273 273 key: 'tid', 274 274 record: { 275 275 type: 'object', 276 - required: ['collection', 'removedLink', 'removedBy', 'removedAt'], 276 + required: ['collection', 'removedLink', 'removedAt'], 277 277 properties: { 278 278 collection: { 279 279 type: 'ref', ··· 286 286 'Strong reference to the collectionLink record that is being removed.', 287 287 ref: 'lex:com.atproto.repo.strongRef', 288 288 }, 289 - removedBy: { 290 - type: 'string', 291 - format: 'did', 292 - description: 293 - 'DID of the user who removed the link (typically the collection owner).', 294 - }, 295 289 removedAt: { 296 290 type: 'string', 297 291 format: 'datetime', 298 292 description: 299 293 'Timestamp when the link was removed from the collection.', 300 - }, 301 - reason: { 302 - type: 'string', 303 - maxLength: 300, 304 - description: 'Optional reason for the removal.', 305 294 }, 306 295 }, 307 296 },
-4
src/modules/atproto/infrastructure/lexicon/types/network/cosmik/collectionLinkRemoval.ts
··· 15 15 $type: 'network.cosmik.collectionLinkRemoval' 16 16 collection: ComAtprotoRepoStrongRef.Main 17 17 removedLink: ComAtprotoRepoStrongRef.Main 18 - /** DID of the user who removed the link (typically the collection owner). */ 19 - removedBy: string 20 18 /** Timestamp when the link was removed from the collection. */ 21 19 removedAt: string 22 - /** Optional reason for the removal. */ 23 - reason?: string 24 20 [k: string]: unknown 25 21 } 26 22
+2 -12
src/modules/atproto/infrastructure/lexicons/collectionLinkRemoval.json
··· 5 5 "defs": { 6 6 "main": { 7 7 "type": "record", 8 - "description": "A record representing the removal of a collection link by a collection owner when they cannot delete the original link (which exists in another user's repository).", 8 + "description": "A record representing the removal of a collection link by a collection owner when they cannot delete the original link (which exists in another user's repository). The creator of this record (determined from the AT-URI) is the user who performed the removal.", 9 9 "key": "tid", 10 10 "record": { 11 11 "type": "object", 12 - "required": ["collection", "removedLink", "removedBy", "removedAt"], 12 + "required": ["collection", "removedLink", "removedAt"], 13 13 "properties": { 14 14 "collection": { 15 15 "type": "ref", ··· 21 21 "description": "Strong reference to the collectionLink record that is being removed.", 22 22 "ref": "com.atproto.repo.strongRef" 23 23 }, 24 - "removedBy": { 25 - "type": "string", 26 - "format": "did", 27 - "description": "DID of the user who removed the link (typically the collection owner)." 28 - }, 29 24 "removedAt": { 30 25 "type": "string", 31 26 "format": "datetime", 32 27 "description": "Timestamp when the link was removed from the collection." 33 - }, 34 - "reason": { 35 - "type": "string", 36 - "maxLength": 300, 37 - "description": "Optional reason for the removal." 38 28 } 39 29 } 40 30 }
-8
src/modules/atproto/infrastructure/mappers/CollectionLinkRemovalMapper.ts
··· 1 1 import { PublishedRecordIdProps } from 'src/modules/cards/domain/value-objects/PublishedRecordId'; 2 - import { CuratorId } from 'src/modules/cards/domain/value-objects/CuratorId'; 3 2 import { Record } from '../lexicon/types/network/cosmik/collectionLinkRemoval'; 4 3 import { EnvironmentConfigService } from 'src/shared/infrastructure/config/EnvironmentConfigService'; 5 4 ··· 14 13 static toCreateRecordDTO( 15 14 collectionPublishedRecordId: PublishedRecordIdProps, 16 15 removedLinkPublishedRecordId: PublishedRecordIdProps, 17 - removedBy: CuratorId, 18 - reason?: string, 19 16 ): CollectionLinkRemovalRecordDTO { 20 17 const record: CollectionLinkRemovalRecordDTO = { 21 18 $type: this.collectionLinkRemovalType as any, ··· 27 24 uri: removedLinkPublishedRecordId.uri, 28 25 cid: removedLinkPublishedRecordId.cid, 29 26 }, 30 - removedBy: removedBy.value, 31 27 removedAt: new Date().toISOString(), 32 28 }; 33 - 34 - if (reason) { 35 - record.reason = reason; 36 - } 37 29 38 30 return record; 39 31 }
-3
src/modules/atproto/infrastructure/publishers/ATProtoCollectionPublisher.ts
··· 282 282 collection: Collection, 283 283 curatorId: CuratorId, 284 284 removedLinkRef: PublishedRecordId, 285 - reason?: string, 286 285 ): Promise<Result<PublishedRecordId, UseCaseError>> { 287 286 try { 288 287 const curatorDidResult = DID.create(curatorId.value); ··· 328 327 const removalRecordDTO = CollectionLinkRemovalMapper.toCreateRecordDTO( 329 328 collection.publishedRecordId.getValue(), 330 329 removedLinkRef.getValue(), 331 - curatorId, 332 - reason, 333 330 ); 334 331 removalRecordDTO.$type = this.collectionLinkRemovalCollection as any; 335 332
-1
src/modules/cards/application/ports/ICollectionPublisher.ts
··· 29 29 collection: Collection, 30 30 curatorId: CuratorId, 31 31 removedLinkRef: PublishedRecordId, 32 - reason?: string, 33 32 ): Promise<Result<PublishedRecordId, UseCaseError>>; 34 33 }
-1
src/modules/cards/tests/utils/FakeCollectionPublisher.ts
··· 152 152 collection: Collection, 153 153 curatorId: CuratorId, 154 154 removedLinkRef: PublishedRecordId, 155 - reason?: string, 156 155 ): Promise<Result<PublishedRecordId, UseCaseError>> { 157 156 if (this.shouldFail) { 158 157 return err(