diff --git a/packages/apps/src/files/files-accessor.spec.ts b/packages/apps/src/files/files-accessor.spec.ts index 62832e9de..bb1ab230a 100644 --- a/packages/apps/src/files/files-accessor.spec.ts +++ b/packages/apps/src/files/files-accessor.spec.ts @@ -36,7 +36,7 @@ describe('FilesAccessor', () => { expect(file.extension).toBe('pdf'); expect(file.scope).toBe('personal'); expect(file.source).toBe('botActivity'); - expect(file.webUrl).toBe('https://contoso.sharepoint.com/report.pdf'); + expect(file.contentUrl).toBe('https://contoso.sharepoint.com/report.pdf'); expect(file.raw).toBe(attachment); }); diff --git a/packages/apps/src/files/files-accessor.ts b/packages/apps/src/files/files-accessor.ts index f80120ed1..d29c3210b 100644 --- a/packages/apps/src/files/files-accessor.ts +++ b/packages/apps/src/files/files-accessor.ts @@ -114,8 +114,8 @@ export class FilesAccessor implements IFilesAccessor { extension: content?.fileType, scope, source: 'botActivity', - // Maps the wire's `contentUrl` (a browsable link to the file in OneDrive/SharePoint) to `webUrl`; not fetchable like `downloadUrl`. - webUrl: attachment.contentUrl, + // Browsable link to the file in OneDrive/SharePoint; not fetchable like `downloadUrl`. + contentUrl: attachment.contentUrl, raw: attachment, downloadUrl, httpClient: this.httpClient, diff --git a/packages/apps/src/files/incoming-file.ts b/packages/apps/src/files/incoming-file.ts index ba5995ade..a708d95d7 100644 --- a/packages/apps/src/files/incoming-file.ts +++ b/packages/apps/src/files/incoming-file.ts @@ -17,7 +17,7 @@ export interface IIncomingFileInit { extension?: string; scope: ConversationType; source: FileSource; - webUrl?: string; + contentUrl?: string; raw?: unknown; /** Short-lived, pre-authorized download URL (personal scope). */ downloadUrl?: string; @@ -37,7 +37,7 @@ export class IncomingFile implements IIncomingFile { readonly extension?: string; readonly scope: ConversationType; readonly source: FileSource; - readonly webUrl?: string; + readonly contentUrl?: string; readonly raw?: unknown; private readonly downloadUrl?: string; @@ -52,7 +52,7 @@ export class IncomingFile implements IIncomingFile { this.extension = init.extension; this.scope = init.scope; this.source = init.source; - this.webUrl = init.webUrl; + this.contentUrl = init.contentUrl; this.raw = init.raw; this.downloadUrl = init.downloadUrl; this._fetch = init.fetch; diff --git a/packages/apps/src/files/types.ts b/packages/apps/src/files/types.ts index 5c00c22cf..62f78429c 100644 --- a/packages/apps/src/files/types.ts +++ b/packages/apps/src/files/types.ts @@ -54,8 +54,12 @@ export interface IIncomingFile { scope: ConversationType; /** Where the SDK found the file. Only `botActivity` is produced today. */ source: FileSource; - /** Web URL to the file in OneDrive/SharePoint when known. */ - webUrl?: string; + /** + * Browsable URL to the file in OneDrive/SharePoint, as sent on the attachment's `contentUrl`. + * + * Not fetchable for bytes despite the name; those come from {@link IIncomingFile.download} or {@link IIncomingFile.stream}. + */ + contentUrl?: string; /** The raw underlying attachment/graph object for escape-hatch access. */ raw?: unknown;