@smartspace/chat-ui 1.14.4-pr.620.883fd31 → 1.14.4-pr.626.0689f4e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -451,7 +451,6 @@ interface ChatService {
451
451
  uploadFiles(files: File[], scope: FileScope, onFileUploaded?: (file: File, fileInfo: FileInfo$1) => void, onChunkUploaded?: (chunkIndex: number, totalChunks: number, file: File) => void): Promise<FileInfo$1[]>;
452
452
  downloadFile(id: string, scope?: FileScope): Promise<Blob>;
453
453
  getFileInfo(id: string, scope: FileScope): Promise<FileInfo$1>;
454
- getFileDownloadUrl(sourceUri: string): Promise<string>;
455
454
  fetchThread(workspaceId: string, threadId: string): Promise<MessageThread>;
456
455
  fetchWorkspace(workspaceId: string): Promise<Workspace>;
457
456
  fetchTaggableUsers(workspaceId: string): Promise<MentionUser[]>;
@@ -1256,9 +1255,6 @@ declare const filesKeys: {
1256
1255
  downloadBlob: (fileId: string) => readonly ["files", "mutation", "downloadBlob", {
1257
1256
  readonly fileId: string;
1258
1257
  }];
1259
- downloadByUri: (uri: string) => readonly ["files", "mutation", "downloadByUri", {
1260
- readonly uri: string;
1261
- }];
1262
1258
  };
1263
1259
  };
1264
1260
 
@@ -1354,10 +1350,6 @@ declare function useMessages(threadId: string): _tanstack_react_query.UseQueryRe
1354
1350
  declare const useFileMutations: (scope: FileScope) => {
1355
1351
  uploadFilesMutation: _tanstack_react_query.UseMutationResult<FileInfo$1[], Error, File[], unknown>;
1356
1352
  downloadFileMutation: _tanstack_react_query.UseMutationResult<void, Error, FileInfo$1, unknown>;
1357
- downloadFileByUriMutation: _tanstack_react_query.UseMutationResult<Blob, Error, {
1358
- name: string;
1359
- sourceUri: string;
1360
- }, unknown>;
1361
1353
  getFileBlobUrl: (id: string) => Promise<string>;
1362
1354
  fileProgress: Record<string, number>;
1363
1355
  uploadedFiles: FileInfo$1[];
package/dist/index.js CHANGED
@@ -115,8 +115,7 @@ var filesKeys = {
115
115
  mutation: {
116
116
  upload: (scope) => [...filesKeys.mutations(), "upload", { scope }],
117
117
  download: (fileId) => [...filesKeys.mutations(), "download", { fileId }],
118
- downloadBlob: (fileId) => [...filesKeys.mutations(), "downloadBlob", { fileId }],
119
- downloadByUri: (uri) => [...filesKeys.mutations(), "downloadByUri", { uri }]
118
+ downloadBlob: (fileId) => [...filesKeys.mutations(), "downloadBlob", { fileId }]
120
119
  }
121
120
  };
122
121
 
@@ -163,20 +162,6 @@ var useFileMutations = (scope) => {
163
162
  },
164
163
  onError: () => toast.error("Failed to download file")
165
164
  });
166
- const downloadFileByUriMutation = useMutation({
167
- mutationFn: async ({
168
- name,
169
- sourceUri
170
- }) => {
171
- const uri = await service.getFileDownloadUrl(sourceUri);
172
- if (!uri) throw new Error("No download URL");
173
- const response = await fetch(uri);
174
- const blob = await response.blob();
175
- saveFile(blob, name);
176
- return blob;
177
- },
178
- onError: () => toast.error("Failed to download file")
179
- });
180
165
  const fileStates = (files) => files.map((file) => ({
181
166
  name: file.name,
182
167
  progress: fileProgress[file.name] ?? 0,
@@ -200,7 +185,6 @@ var useFileMutations = (scope) => {
200
185
  return {
201
186
  uploadFilesMutation,
202
187
  downloadFileMutation,
203
- downloadFileByUriMutation,
204
188
  getFileBlobUrl,
205
189
  fileProgress,
206
190
  uploadedFiles,