@buerokratt-ria/common-gui-components 0.0.48 → 0.0.49

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/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ All changes to this project will be documented in this file.
4
4
 
5
5
  ## Template [MajorVersion.MediterraneanVersion.MinorVersion] - DD-MM-YYYY
6
6
 
7
+ ## [0.0.49] - 29.04.2026
8
+
9
+ - Fixed chat history XLSX download to use the S3 signed URL returned by the API instead of the previous base64 payload.
10
+
7
11
  ## [0.0.48] - 23.04.2026
8
12
 
9
13
  - Added chats preserve feature
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buerokratt-ria/common-gui-components",
3
- "version": "0.0.48",
3
+ "version": "0.0.49",
4
4
  "description": "Common GUI components and pre defined templates.",
5
5
  "main": "index.ts",
6
6
  "author": "ExiRai",
package/services/file.ts CHANGED
@@ -1,42 +1,11 @@
1
- /**
2
- * Converts a base64 string to a Uint8Array (browser-compatible alternative to Buffer)
3
- */
4
- const base64ToUint8Array = (base64: string): Uint8Array<ArrayBuffer> => {
5
- const binaryString = atob(base64);
6
- const bytes = new Uint8Array(binaryString.length);
7
- for (let i = 0; i < binaryString.length; i++) {
8
- bytes[i] = binaryString.charCodeAt(i);
9
- }
10
- return bytes;
11
- };
12
-
13
- export const saveFile = async (base64String: string, fileName: `${string}.${string}`, type: string) => {
14
- const bytes = base64ToUint8Array(base64String);
15
- const blob = new Blob([bytes], {
16
- type: type,
17
- });
18
-
19
- const extension = fileName.split('.').pop();
20
-
21
- if (window.showSaveFilePicker) {
22
- const handle = await window.showSaveFilePicker({
23
- suggestedName: fileName,
24
- types: [
25
- {
26
- description: extension!.toUpperCase() + ' file',
27
- accept: { [type]: [`.${extension}` as `.${string}`] },
28
- },
29
- ],
30
- });
31
- const writable = await handle.createWritable();
32
- await writable.write(blob);
33
- writable.close();
34
- } else {
35
- const url = window.URL.createObjectURL(blob);
36
- const a = document.createElement('a');
37
- a.href = url;
38
- a.download = fileName;
39
- a.click();
40
- window.URL.revokeObjectURL(url);
41
- }
1
+ export const saveFile = async (
2
+ fileUrl: string,
3
+ fileName: `${string}.${string}`,
4
+ ) => {
5
+ const a = document.createElement('a');
6
+ a.href = fileUrl;
7
+ a.download = fileName;
8
+ document.body.appendChild(a);
9
+ a.click();
10
+ a.remove();
42
11
  };
@@ -1024,15 +1024,15 @@ const ChatHistory: FC<PropsWithChildren<HistoryProps>> = ({
1024
1024
  customerSupportIds: passedCustomerSupportIds,
1025
1025
  });
1026
1026
 
1027
+ const downloadData = response.data.data ?? response.data;
1027
1028
 
1028
1029
  await saveFile(
1029
- response.data.base64String,
1030
+ downloadData.url,
1030
1031
  'history.xlsx',
1031
- 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
1032
1032
  );
1033
1033
 
1034
1034
  } catch (error) {
1035
- console.error('Error getting CSV file:', error);
1035
+ console.error('Error downloading chat history file:', error);
1036
1036
  } finally {
1037
1037
  setLoading(false);
1038
1038
  }