Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/apps/src/files/files-accessor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand Down
4 changes: 2 additions & 2 deletions packages/apps/src/files/files-accessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions packages/apps/src/files/incoming-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface IIncomingFileInit {
extension?: string;
scope: ConversationType;
source: FileSource;
webUrl?: string;
contentUrl?: string;
raw?: unknown;
Comment thread
corinagum marked this conversation as resolved.
/** Short-lived, pre-authorized download URL (personal scope). */
downloadUrl?: string;
Expand All @@ -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;
Expand All @@ -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;
Expand Down
8 changes: 6 additions & 2 deletions packages/apps/src/files/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Loading