rio-assist-widget 0.1.18 → 0.1.26
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/README.md +9 -3
- package/dist/rio-assist.js +201 -65
- package/index.html +1 -2
- package/package.json +1 -1
- package/src/components/conversations-panel/conversations-panel.template.ts +12 -8
- package/src/components/mini-panel/mini-panel.styles.ts +66 -13
- package/src/components/mini-panel/mini-panel.template.ts +4 -1
- package/src/components/rio-assist/rio-assist.styles.ts +30 -1
- package/src/components/rio-assist/rio-assist.template.ts +65 -0
- package/src/components/rio-assist/rio-assist.ts +1433 -1008
- package/src/main.ts +15 -9
- package/src/playground.ts +9 -3
- package/src/services/rioWebsocket.ts +23 -0
package/src/main.ts
CHANGED
|
@@ -13,15 +13,21 @@ export type RioAssistOptions = {
|
|
|
13
13
|
|
|
14
14
|
const DEFAULT_OPTIONS: Required<Omit<RioAssistOptions, 'target'>> = {
|
|
15
15
|
title: 'Rio Insight',
|
|
16
|
-
buttonLabel: 'Rio Insight',
|
|
17
|
-
placeholder: 'Pergunte alguma coisa',
|
|
18
|
-
suggestions: [
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
buttonLabel: 'Rio Insight',
|
|
17
|
+
placeholder: 'Pergunte alguma coisa',
|
|
18
|
+
suggestions: [
|
|
19
|
+
'Resumo da Frota',
|
|
20
|
+
'Frota Disponível',
|
|
21
|
+
'Chamados Abertos',
|
|
22
|
+
'Parados + Causas',
|
|
23
|
+
'Aguardando Peças',
|
|
24
|
+
'Principais Gargalos',
|
|
25
|
+
'Tempo por Concessionária',
|
|
26
|
+
'Tempo de Ciclo',
|
|
27
|
+
'Preventiva x Corretiva',
|
|
28
|
+
],
|
|
29
|
+
accentColor: '#008B9A',
|
|
30
|
+
apiBaseUrl: '',
|
|
25
31
|
rioToken: '',
|
|
26
32
|
};
|
|
27
33
|
|
package/src/playground.ts
CHANGED
|
@@ -11,9 +11,15 @@ const boot = () => {
|
|
|
11
11
|
rioToken,
|
|
12
12
|
apiBaseUrl,
|
|
13
13
|
suggestions: [
|
|
14
|
-
'
|
|
15
|
-
'
|
|
16
|
-
'
|
|
14
|
+
'Resumo da Frota',
|
|
15
|
+
'Frota Disponível',
|
|
16
|
+
'Chamados Abertos',
|
|
17
|
+
'Parados + Causas',
|
|
18
|
+
'Aguardando Peças',
|
|
19
|
+
'Principais Gargalos',
|
|
20
|
+
'Tempo por Concessionária',
|
|
21
|
+
'Tempo de Ciclo',
|
|
22
|
+
'Preventiva x Corretiva',
|
|
17
23
|
],
|
|
18
24
|
});
|
|
19
25
|
};
|
|
@@ -50,6 +50,29 @@ export class RioWebsocketClient {
|
|
|
50
50
|
|
|
51
51
|
socket.send(JSON.stringify(payload));
|
|
52
52
|
}
|
|
53
|
+
|
|
54
|
+
async renameConversation(conversationId: string, newTitle: string) {
|
|
55
|
+
const socket = await this.ensureConnection();
|
|
56
|
+
const payload = {
|
|
57
|
+
action: 'renameConversation',
|
|
58
|
+
conversationId,
|
|
59
|
+
newTitle,
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
console.info('[RioAssist][ws] enviando renameConversation', payload);
|
|
63
|
+
socket.send(JSON.stringify(payload));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
async deleteConversation(conversationId: string) {
|
|
67
|
+
const socket = await this.ensureConnection();
|
|
68
|
+
const payload = {
|
|
69
|
+
action: 'deleteConversation',
|
|
70
|
+
conversationId,
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
console.info('[RioAssist][ws] enviando deleteConversation', payload);
|
|
74
|
+
socket.send(JSON.stringify(payload));
|
|
75
|
+
}
|
|
53
76
|
|
|
54
77
|
onMessage(listener: (message: RioIncomingMessage) => void) {
|
|
55
78
|
this.listeners.add(listener);
|