diff --git a/src/MediaSharingApi.ts b/src/MediaSharingApi.ts index 28906ca..af9d527 100644 --- a/src/MediaSharingApi.ts +++ b/src/MediaSharingApi.ts @@ -73,7 +73,7 @@ export class MediaSharingApi { const { message: payload } = await this.mediaSharingService.createMediaShare(this.agentContext, { record: record, - items: options.items?.map(item => new SharedMediaItem(item)), + items: options.items?.map((item) => new SharedMediaItem(item)), description: options.description, parentThreadId: options.parentThreadId, }) diff --git a/src/repository/MediaSharingRecord.ts b/src/repository/MediaSharingRecord.ts index 8f426a2..becfc38 100644 --- a/src/repository/MediaSharingRecord.ts +++ b/src/repository/MediaSharingRecord.ts @@ -16,19 +16,18 @@ export interface SharedMediaItemOptions extends Omit } export class SharedMediaItem extends Attachment { - @Exclude() public get uri() { return this.data.links ? this.data.links[0] : undefined } public ciphering?: CipheringInfo - public metadata?: Record + public metadata?: Record public constructor(options: SharedMediaItemOptions) { - super({ ...options, data: new AttachmentData({ links: [ options?.uri ] })}) + super({ ...options, data: new AttachmentData({ links: [options?.uri] }) }) if (options) { - this.ciphering = options.ciphering + this.ciphering = options.ciphering this.metadata = options.metadata } } diff --git a/test/mediasharing.test.ts b/test/mediasharing.test.ts index a9f9df3..b535fa7 100644 --- a/test/mediasharing.test.ts +++ b/test/mediasharing.test.ts @@ -142,6 +142,5 @@ describe('media test', () => { expect(bobRecord.items?.length).toBe(1) expect(bobRecord.items![0].mimeType).toBe('image/png') expect(bobRecord.items![0].uri).toBe('http://blabla') - }) })