Open rasmusei opened 2 years ago
Virus check for attachments applied
slows down this issue.DSL for phase 3 development
@turnerrainer This is how its currently implemented: PR which will have to be updated: https://github.com/buerokratt/Chat-Widget/pull/12
Implementation:
export interface MessageFile {
name: string;
type: MessageFileTypes;
size: number;
base64: string;
}
export interface Message {
chatId: string | null;
id?: string;
content?: string;
file?: MessageFile; // ←—------ Added this
event?: string;
rating?: string;
authorId?: string;
authorTimestamp: string;
authorFirstName?: string;
authorLastName?: string;
authorRole?: string;
created?: string;
updated?: string;
data?: {
forwarding_validation?: string;
};
}
export enum MessageFileTypes {
// TODO add correct file types Ticket: https://github.com/buerokratt/Buerokratt-Chatbot/issues/30
PDF = 'application/pdf',
PNG = 'image/png',
JPEG = 'image/jpeg',
TXT = 'text/plain', // TODO SLICE NAME
DOCX = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', // TODO SLICE NAME
ODT = 'application/vnd.oasis.opendocument.text', // NOT SPECIFIED
XLSX = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', // TODO SLICE NAME
// ODS = 'ods', // NOT SPECIFIED
BDOC = 'application/vnd.etsi.asic-e+zip', // TODO VERIFY, could not find an example
CDOC = 'application/x-cdoc', // NOT SPECIFIED
ASICE = 'application/vnd.etsi.asic-e+zip', // TODO SLICE NAME
MP3 = 'audio/mpeg', // TODO VERIFY, could not find an example
WAV = 'audio/wav', // TODO VERIFY, could not find an example
M4A = 'audio/x-m4a',
MP4 = 'video/mp4',// TODO
WEBM = 'video/webm',// TODO
OGG = 'video/ogg',// TODO
MOV = 'video/quicktime',// TODO
}
Questions:
export interface MessageFile {
name: string;
type: MessageFileTypes;
size: number;
base64?: string; ←— base64 file when sending message. Empty when receiving.
url?: string; ←— file download link will be added here when receiving message! Or combine them both into data: ""?
}`
https://github.com/buerokratt/Chat-Widget/pull/12 Currently, Work In Progress!
@sergeirudz
Will the file message just contain the URL to CDN to download the file?
Ruuter DSL will contain appropriate headers to force the browser to download the file. No need for a CDN link.
@sergeirudz
GUI has to make a POST request towards Ruuter endpoint /attachments/add
with the content described by you:
export interface MessageFile {
name: string;
type: MessageFileTypes;
size: number;
base64: string;
}
PR: https://github.com/buerokratt/Chat-Widget/pull/12 Added POST request to '/attachments/add'
I added chatId key!!!
export interface Attachment {
chatId: string;
name: string;
type: AttachmentTypes;
size: number;
base64: string;
}
export enum AttachmentTypes {
PDF = 'application/pdf',
PNG = 'image/png',
JPEG = 'image/jpeg',
TXT = 'text/plain',
DOCX = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
ODT = 'application/vnd.oasis.opendocument.text',
XLSX = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
ODS = 'ods',
BDOC = 'application/vnd.etsi.asic-e+zip',
CDOC = 'application/x-cdoc',
ASICE = 'application/vnd.etsi.asic-e+zip',
MP3 = 'audio/mpeg',
WAV = 'audio/wav',
M4A = 'audio/x-m4a',
MP4 = 'video/mp4',
WEBM = 'video/webm',
OGG = 'video/ogg',
MOV = 'video/quicktime',
}
Widget Branch https://github.com/sergeirudz/Chat-Widget/tree/30-possibility-to-send-attachments PR: https://github.com/buerokratt/Chat-Widget/pull/12
Admin Ticket buerokratt/Buerokratt-Chatbot#30 Admin poolne tehtud https://github.com/buerokratt/Buerokratt-Chatbot/issues/30 PR: https://github.com/buerokratt/Buerokratt-Chatbot/pull/180
@turnerrainer lets have 3 options in admin module (in Vestlusrobot -> Seaded page) for attachments: 1) end-user to CSA attachments allowed/not allowed; 2) end-user to CSA attachments allowed only if end-user is authenticated (needs authentication to be triggered after pressing attachment button); 3) CSA to end-user attachments allowed/not allowed. Each organization can decide by themselves whether they allow attachments to be sent. In case allowed - should the attachments be downloaded first in order to open or can be opened immediately from chat?
AS AN End User and CSA I WANT TO be able to send attachments via chatbot SO THAT I could provide other party necessary information
Acceptance Criteria
Settings
DSL
GUI
base64
via~ ~#67~To Consider
pre-signed URLs
straight from React to S3 bucket