diff --git a/src/modules/atproto/infrastructure/lexicon/lexicons.ts b/src/modules/atproto/infrastructure/lexicon/lexicons.ts index da28cf9d..e198eb74 100644 --- a/src/modules/atproto/infrastructure/lexicon/lexicons.ts +++ b/src/modules/atproto/infrastructure/lexicon/lexicons.ts @@ -269,11 +269,11 @@ export const schemaDict = { main: { type: 'record', 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).", + "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.", key: 'tid', record: { type: 'object', - required: ['collection', 'removedLink', 'removedBy', 'removedAt'], + required: ['collection', 'removedLink', 'removedAt'], properties: { collection: { type: 'ref', @@ -286,23 +286,12 @@ export const schemaDict = { 'Strong reference to the collectionLink record that is being removed.', ref: 'lex:com.atproto.repo.strongRef', }, - removedBy: { - type: 'string', - format: 'did', - description: - 'DID of the user who removed the link (typically the collection owner).', - }, removedAt: { type: 'string', format: 'datetime', description: 'Timestamp when the link was removed from the collection.', }, - reason: { - type: 'string', - maxLength: 300, - description: 'Optional reason for the removal.', - }, }, }, }, diff --git a/src/modules/atproto/infrastructure/lexicon/types/network/cosmik/collectionLinkRemoval.ts b/src/modules/atproto/infrastructure/lexicon/types/network/cosmik/collectionLinkRemoval.ts index 8d5a775c..a396ac41 100644 --- a/src/modules/atproto/infrastructure/lexicon/types/network/cosmik/collectionLinkRemoval.ts +++ b/src/modules/atproto/infrastructure/lexicon/types/network/cosmik/collectionLinkRemoval.ts @@ -15,12 +15,8 @@ export interface Record { $type: 'network.cosmik.collectionLinkRemoval' collection: ComAtprotoRepoStrongRef.Main removedLink: ComAtprotoRepoStrongRef.Main - /** DID of the user who removed the link (typically the collection owner). */ - removedBy: string /** Timestamp when the link was removed from the collection. */ removedAt: string - /** Optional reason for the removal. */ - reason?: string [k: string]: unknown } diff --git a/src/modules/atproto/infrastructure/lexicons/collectionLinkRemoval.json b/src/modules/atproto/infrastructure/lexicons/collectionLinkRemoval.json index 7237630d..3636dc84 100644 --- a/src/modules/atproto/infrastructure/lexicons/collectionLinkRemoval.json +++ b/src/modules/atproto/infrastructure/lexicons/collectionLinkRemoval.json @@ -5,11 +5,11 @@ "defs": { "main": { "type": "record", - "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).", + "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.", "key": "tid", "record": { "type": "object", - "required": ["collection", "removedLink", "removedBy", "removedAt"], + "required": ["collection", "removedLink", "removedAt"], "properties": { "collection": { "type": "ref", @@ -21,20 +21,10 @@ "description": "Strong reference to the collectionLink record that is being removed.", "ref": "com.atproto.repo.strongRef" }, - "removedBy": { - "type": "string", - "format": "did", - "description": "DID of the user who removed the link (typically the collection owner)." - }, "removedAt": { "type": "string", "format": "datetime", "description": "Timestamp when the link was removed from the collection." - }, - "reason": { - "type": "string", - "maxLength": 300, - "description": "Optional reason for the removal." } } } diff --git a/src/modules/atproto/infrastructure/mappers/CollectionLinkRemovalMapper.ts b/src/modules/atproto/infrastructure/mappers/CollectionLinkRemovalMapper.ts index cc88f5b8..0297a912 100644 --- a/src/modules/atproto/infrastructure/mappers/CollectionLinkRemovalMapper.ts +++ b/src/modules/atproto/infrastructure/mappers/CollectionLinkRemovalMapper.ts @@ -1,5 +1,4 @@ import { PublishedRecordIdProps } from 'src/modules/cards/domain/value-objects/PublishedRecordId'; -import { CuratorId } from 'src/modules/cards/domain/value-objects/CuratorId'; import { Record } from '../lexicon/types/network/cosmik/collectionLinkRemoval'; import { EnvironmentConfigService } from 'src/shared/infrastructure/config/EnvironmentConfigService'; @@ -14,8 +13,6 @@ export class CollectionLinkRemovalMapper { static toCreateRecordDTO( collectionPublishedRecordId: PublishedRecordIdProps, removedLinkPublishedRecordId: PublishedRecordIdProps, - removedBy: CuratorId, - reason?: string, ): CollectionLinkRemovalRecordDTO { const record: CollectionLinkRemovalRecordDTO = { $type: this.collectionLinkRemovalType as any, @@ -27,14 +24,9 @@ export class CollectionLinkRemovalMapper { uri: removedLinkPublishedRecordId.uri, cid: removedLinkPublishedRecordId.cid, }, - removedBy: removedBy.value, removedAt: new Date().toISOString(), }; - if (reason) { - record.reason = reason; - } - return record; } } diff --git a/src/modules/atproto/infrastructure/publishers/ATProtoCollectionPublisher.ts b/src/modules/atproto/infrastructure/publishers/ATProtoCollectionPublisher.ts index dff2822b..31994ce2 100644 --- a/src/modules/atproto/infrastructure/publishers/ATProtoCollectionPublisher.ts +++ b/src/modules/atproto/infrastructure/publishers/ATProtoCollectionPublisher.ts @@ -282,7 +282,6 @@ export class ATProtoCollectionPublisher implements ICollectionPublisher { collection: Collection, curatorId: CuratorId, removedLinkRef: PublishedRecordId, - reason?: string, ): Promise> { try { const curatorDidResult = DID.create(curatorId.value); @@ -328,8 +327,6 @@ export class ATProtoCollectionPublisher implements ICollectionPublisher { const removalRecordDTO = CollectionLinkRemovalMapper.toCreateRecordDTO( collection.publishedRecordId.getValue(), removedLinkRef.getValue(), - curatorId, - reason, ); removalRecordDTO.$type = this.collectionLinkRemovalCollection as any; diff --git a/src/modules/cards/application/ports/ICollectionPublisher.ts b/src/modules/cards/application/ports/ICollectionPublisher.ts index 1ba6c70e..dfaeb17c 100644 --- a/src/modules/cards/application/ports/ICollectionPublisher.ts +++ b/src/modules/cards/application/ports/ICollectionPublisher.ts @@ -29,6 +29,5 @@ export interface ICollectionPublisher { collection: Collection, curatorId: CuratorId, removedLinkRef: PublishedRecordId, - reason?: string, ): Promise>; } diff --git a/src/modules/cards/tests/utils/FakeCollectionPublisher.ts b/src/modules/cards/tests/utils/FakeCollectionPublisher.ts index 89e6a3be..aaeca46a 100644 --- a/src/modules/cards/tests/utils/FakeCollectionPublisher.ts +++ b/src/modules/cards/tests/utils/FakeCollectionPublisher.ts @@ -152,7 +152,6 @@ export class FakeCollectionPublisher implements ICollectionPublisher { collection: Collection, curatorId: CuratorId, removedLinkRef: PublishedRecordId, - reason?: string, ): Promise> { if (this.shouldFail) { return err(