diff --git a/README.md b/README.md index 14a07f20..d91b3990 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ PS D:\> npm run dev Access http://localhost:5015/ - + ### Core Modules diff --git a/docs/static/screenshots/agent-builder-conversations.png b/docs/static/screenshots/agent-builder-conversations.png new file mode 100644 index 00000000..59302c64 Binary files /dev/null and b/docs/static/screenshots/agent-builder-conversations.png differ diff --git a/src/agent-builder/src/lib/common/NotificationDropdown.svelte b/src/agent-builder/src/lib/common/NotificationDropdown.svelte index 8086dbbe..c24f17a2 100644 --- a/src/agent-builder/src/lib/common/NotificationDropdown.svelte +++ b/src/agent-builder/src/lib/common/NotificationDropdown.svelte @@ -27,7 +27,7 @@ - 3 + 1
@@ -59,63 +59,6 @@
- -
- user-pic -
-
James Lemire
-
-

It will seem like simplified English.

-

- 1 hours ago -

-
-
-
- - -
-
- - - -
-
-
Your item is shipped
-
-

If several languages coalesce the grammar

-

- 3 min ago -

-
-
-
- - - -
- user-pic -
-
Salena Layfield
-
-

- As a skeptical Cambridge friend of mine occidental. -

-

- 1 hours ago -

-
-
-
-
diff --git a/src/agent-builder/src/lib/common/ProfileDropdown.svelte b/src/agent-builder/src/lib/common/ProfileDropdown.svelte index 140c355b..8f1dfa9c 100644 --- a/src/agent-builder/src/lib/common/ProfileDropdown.svelte +++ b/src/agent-builder/src/lib/common/ProfileDropdown.svelte @@ -28,19 +28,11 @@ > Profile - - My Wallet - 11 Settings - - - Lock screen -
diff --git a/src/agent-builder/src/lib/common/data/Layoutmenudata.js b/src/agent-builder/src/lib/common/data/Layoutmenudata.js index 20e3a501..fc6f8567 100644 --- a/src/agent-builder/src/lib/common/data/Layoutmenudata.js +++ b/src/agent-builder/src/lib/common/data/Layoutmenudata.js @@ -14,7 +14,7 @@ const Navdata = [ }, { "icon": "bx bx-conversation", - "label": "Conversation", + "label": "Conversations", "link": "/conversation" }, { diff --git a/src/agent-builder/src/lib/langs/en.json b/src/agent-builder/src/lib/langs/en.json index d7b13e8e..fb8b103a 100644 --- a/src/agent-builder/src/lib/langs/en.json +++ b/src/agent-builder/src/lib/langs/en.json @@ -177,7 +177,6 @@ "As a skeptical Cambridge friend of mine occidental": "As a skeptical Cambridge friend of mine occidental", "1 hours ago": "1 hours ago", "View More": "View More", - "My Wallet": "My Wallet", "Settings": "Settings", "Logout": "Logout" } \ No newline at end of file diff --git a/src/agent-builder/src/lib/scss/app.scss b/src/agent-builder/src/lib/scss/app.scss index fb5d2aeb..fd86dea0 100644 --- a/src/agent-builder/src/lib/scss/app.scss +++ b/src/agent-builder/src/lib/scss/app.scss @@ -72,13 +72,11 @@ File: Main Css File // Pages @import "custom/pages/authentication"; -@import "custom/pages/ecommerce"; @import "custom/pages/email"; @import "custom/pages/file-manager"; @import "custom/pages/chat"; @import "custom/pages/projects"; @import "custom/pages/contacts"; -@import "custom/pages/crypto"; @import "custom/pages/coming-soon"; @import "custom/pages/timeline"; @import "custom/pages/extras-pages"; diff --git a/src/agent-builder/src/lib/scss/custom/pages/_crypto.scss b/src/agent-builder/src/lib/scss/custom/pages/_crypto.scss deleted file mode 100644 index 1ef03ecf..00000000 --- a/src/agent-builder/src/lib/scss/custom/pages/_crypto.scss +++ /dev/null @@ -1,355 +0,0 @@ -// -// crypto.scss -// - -@media (min-width: 576px) { - .currency-value { - position: relative; - - &:after { - content: "\F04E1"; - font-family: "Material Design Icons"; - font-size: 24px; - position: absolute; - width: 45px; - height: 45px; - line-height: 45px; - border-radius: 50%; - text-align: center; - right: 0; - top: 50%; - transform: translateY(-50%); - background-color: $primary; - color: $white; - z-index: 9; - right: -34px; - } - } - -} - -.crypto-buy-sell-nav-content { - border: 2px solid var(--#{$prefix}border-color); - border-top: 0; -} - - -// KYC Application - -.kyc-doc-verification { - .dropzone { - min-height: 180px; - - .dz-message { - margin: 24px 0px; - } - } -} - - -/****************** - Ico Landing -*******************/ - -.section { - position: relative; - padding-top: 80px; - padding-bottom: 80px; - - &.bg-white { - background-color: var(--#{$prefix}secondary-bg) !important; - } -} - -.small-title { - color: var(--#{$prefix}secondary-color); - margin-bottom: 8px; -} - - -// Navigation - -.navigation { - padding: 0 16px; - width: 100%; - z-index: 999; - margin-bottom: 0px; - transition: all 0.5s ease-in-out; - border-bottom: 1px solid rgba($white, 0.1); - - @media (max-width: 991.98px) { - background-color: var(--#{$prefix}topnav-bg); - } - - .navbar-logo { - line-height: 70px; - transition: all 0.4s; - - .logo-dark { - display: none; - - @media (max-width: 991.98px) { - display: block; - } - } - - .logo-light { - display: block; - - @media (max-width: 991.98px) { - display: none; - } - } - } - - - .navbar-nav { - .nav-item { - .nav-link { - color: rgba($white, 0.6); - line-height: 58px; - padding: 6px 16px; - font-weight: $font-weight-medium; - transition: all 0.4s; - - @media (max-width: 991.98px) { - color: var(--#{$prefix}header-item-color); - } - - &:hover, - &.active { - color: rgba($white, 0.9); - - @media (max-width: 991.98px) { - color: $primary; - } - } - - @media (max-width: 991.98px) { - line-height: 28px !important; - } - } - } - } - - &.nav-sticky { - background-color: var(--#{$prefix}topnav-bg); - box-shadow: $box-shadow; - - .navbar-logo { - line-height: 60px; - - .logo-dark { - display: var(--#{$prefix}display-block); - } - - .logo-light { - display: var(--#{$prefix}display-none); - } - } - - .navbar-nav { - .nav-item { - .nav-link { - line-height: 48px; - color: var(--#{$prefix}header-item-color); - - &:hover, - &.active { - color: $primary; - } - } - } - } - } -} - -.bg-overlay { - position: absolute; - height: 100%; - width: 100%; - right: 0; - bottom: 0; - left: 0; - top: 0; - opacity: 0.7; - background-color: $black; -} - -.hero-section { - padding-top: 220px; - padding-bottom: 190px; - - &.bg-ico-hero { - background-image: url("../images/crypto/bg-ico-hero.jpg"); - background-size: cover; - background-position: top; - } - - @media (max-width: 575.98px) { - padding-top: 140px; - padding-bottom: 80px; - } - - .hero-title { - font-size: 42px; - - @media (max-width: 575.98px) { - font-size: 26px; - } - } - - .ico-countdown { - font-size: 22px; - margin-right: -12px; - margin-left: -12px; - - @media (max-width: 575.98px) { - display: block; - } - - .coming-box { - margin-right: 12px; - margin-left: 12px; - border: 1px solid var(--#{$prefix}border-color); - border-radius: 4px; - padding: 8px; - background-color: var(--#{$prefix}secondary-bg); - - @media (max-width: 575.98px) { - display: inline-block; - width: 40%; - margin-bottom: 24px; - } - - span { - background-color: var(--#{$prefix}light); - font-size: 12px; - padding: 4px; - margin-top: 8px; - } - } - } - - .softcap-progress { - overflow: visible; - - .progress-bar { - overflow: visible; - } - - .progress-label { - position: relative; - text-align: right; - color: var(--#{$prefix}body-color); - bottom: 20px; - font-size: 12px; - font-weight: $font-weight-medium; - } - } -} - - -// currency price - -.currency-price { - position: relative; - bottom: 40px; -} - - -// Clients - -.client-images { - img { - max-height: 34px; - width: auto !important; - margin: 12px auto; - opacity: 0.7; - transition: all 0.4s; - } -} - - -// Features - -.features-number { - opacity: 0.1; -} - - -// Team - -.team-box { - .team-social-links { - a { - color: var(--#{$prefix}body-color); - font-size: 14px; - } - } -} - -// Blog - -.blog-box { - .blog-badge { - position: absolute; - top: 12px; - right: 12px; - } -} - -// landing footer - -.landing-footer { - padding: 80px 0 40px; - background-color: $sidebar-dark-bg; - color: rgba($white, 0.5); - - .footer-list-title { - color: rgba($white, 0.9); - } - - .footer-list-menu { - li { - a { - display: block; - color: rgba($white, 0.5); - margin-bottom: 14px; - transition: all 0.4s; - - &:hover { - color: rgba($white, 0.8); - } - } - } - } - - .blog-post { - - .post { - display: block; - color: rgba($white, 0.5); - padding: 16px 0px; - border-bottom: 1px solid rgba($white, 0.1); - - .post-title { - color: rgba($white, 0.8); - font-size: 14px; - } - - &:first-of-type { - padding-top: 0; - } - - &:last-of-type { - padding-bottom: 0; - border-bottom: 0; - } - } - } - - .footer-border { - border-color: rgba($white, 0.1); - } -} \ No newline at end of file diff --git a/src/agent-builder/src/lib/scss/custom/pages/_ecommerce.scss b/src/agent-builder/src/lib/scss/custom/pages/_ecommerce.scss deleted file mode 100644 index 04df1986..00000000 --- a/src/agent-builder/src/lib/scss/custom/pages/_ecommerce.scss +++ /dev/null @@ -1,121 +0,0 @@ -// -// ecommerce.scss -// - -// product - -.search-box{ - .form-control{ - border-radius: 30px; - padding-left: 40px; - } - .search-icon{ - font-size: 16px; - position: absolute; - left: 13px; - top: 0; - line-height: 38px; - } -} - -.product-list{ - li{ - a{ - display: block; - padding: 4px 0px; - color: var(--#{$prefix}body-color); - } - } -} - -.product-view-nav{ - &.nav-pills { - .nav-item{ - margin-left: 4px; - } - .nav-link{ - width: 36px; - height: 36px; - font-size: 16px; - padding: 0; - line-height: 36px; - text-align: center; - border-radius: 50%; - } - } -} - -.product-ribbon{ - position: absolute; - right: 0px; - top: 0px; -} - -// Product Details - -.product-detai-imgs{ - .nav{ - .nav-link{ - margin: 7px 0px; - - &.active{ - background-color: var(--#{$prefix}tertiary-bg); - } - } - } -} - -.product-color{ - a{ - display: inline-block; - text-align: center; - color: var(--#{$prefix}body-color); - .product-color-item{ - margin: 7px; - } - &.active, &:hover{ - color: $primary; - .product-color-item{ - border-color: $primary !important; - } - } - } -} - -// ecommerce cart - -.visa-card{ - .visa-logo{ - line-height: 0.5; - } - - .visa-pattern{ - position: absolute; - font-size: 385px; - color: rgba($white, 0.05); - line-height: 0.4; - right: 0px; - bottom: 0px; - } -} - - -// checkout - -.checkout-tabs{ - .nav-pills{ - .nav-link{ - margin-bottom: 24px; - text-align: center; - background-color: var(--#{$prefix}secondary-bg); - box-shadow: $box-shadow; - - &.active{ - background-color: $primary; - } - .check-nav-icon{ - font-size: 36px; - } - } - } -} \ No newline at end of file diff --git a/src/agent-builder/src/lib/services/agent-service.js b/src/agent-builder/src/lib/services/agent-service.js index 7a4f26fb..ee85ec01 100644 --- a/src/agent-builder/src/lib/services/agent-service.js +++ b/src/agent-builder/src/lib/services/agent-service.js @@ -1,5 +1,5 @@ import { getUserStore } from '$lib/helpers/store.js'; -import { agentListUrl, agentDetailUrl } from '$lib/services/api-endpoints.js'; +import { endpoints } from '$lib/services/api-endpoints.js'; export async function getAgents() { let user = getUserStore(); @@ -7,7 +7,7 @@ export async function getAgents() { Authorization: `Bearer ${user.token}`, }; - const response = await fetch(agentListUrl, { + const response = await fetch(endpoints.agentListUrl, { headers: headers }).then(response => { if (response.ok) { @@ -28,7 +28,7 @@ export async function getAgent(id) { Authorization: `Bearer ${user.token}`, }; - const response = await fetch(agentDetailUrl.replace("{id}", id), { + const response = await fetch(endpoints.agentDetailUrl.replace("{id}", id), { headers: headers }).then(response => { if (response.ok) { diff --git a/src/agent-builder/src/lib/services/api-endpoints.js b/src/agent-builder/src/lib/services/api-endpoints.js index 1a0ae075..2b8097e4 100644 --- a/src/agent-builder/src/lib/services/api-endpoints.js +++ b/src/agent-builder/src/lib/services/api-endpoints.js @@ -1,26 +1,27 @@ -const host = 'http://localhost:5500'; +export const host = 'http://localhost:5500'; -// user -export const tokenUrl = `${host}/token`; -export const myInfoUrl = `${host}/user/my`; -export const usrCreationUrl = `${host}/user`; +export const endpoints = { + // user + tokenUrl: `${host}/token`, + myInfoUrl: `${host}/user/my`, + usrCreationUrl: `${host}/user`, + + // plugin + pluginListUrl: `${host}/plugins`, + + // agent + agentListUrl: `${host}/agents`, + agentDetailUrl: `${host}/agent/{id}`, + + // conversation + conversationInitUrl: `${host}/conversation/{agentId}`, + conversationMessageUrl: `${host}/conversation/{agentId}/{conversationId}`, + conversationsUrl: `${host}/conversations`, + conversationCountUrl: `${host}/conversations/count`, + conversationDeletionUrl: `${host}/conversation/{conversationId}`, + dialogsUrl: `${host}/conversation/{conversationId}/dialogs`, + + // chathub + chatHubUrl: `${host}/chatHub`, +} -// plugin -export const pluginListUrl = `${host}/plugins`; - -// agent -export const agentListUrl = `${host}/agents`; -export const agentDetailUrl = `${host}/agent/{id}`; - -// conversation -export const conversationInitUrl = `${host}/conversation/{agentId}` -export const conversationMessageUrl = `${host}/conversation/{agentId}/{conversationId}` -export const conversationsUrl = `${host}/conversations` -export const conversationCountUrl = `${host}/conversations/count` -export const dialogsUrl = `${host}/conversation/{conversationId}/dialogs` - -// chathub -export const chatHubUrl = `${host}/chatHub`; - -// Twilio -export const twilioAccessTokenUrl = `${host}/twilio/token`; \ No newline at end of file diff --git a/src/agent-builder/src/lib/services/auth-service.js b/src/agent-builder/src/lib/services/auth-service.js index faf2d53a..3784f3fd 100644 --- a/src/agent-builder/src/lib/services/auth-service.js +++ b/src/agent-builder/src/lib/services/auth-service.js @@ -1,5 +1,6 @@ import { userStore, getUserStore } from '$lib/helpers/store.js'; -import { tokenUrl, myInfoUrl, usrCreationUrl } from './api-endpoints.js'; +import { setAuthorization } from '$lib/helpers/http'; +import { endpoints } from './api-endpoints.js'; import axios from 'axios'; /** @@ -13,7 +14,7 @@ export async function getToken(email, password, onSucceed) { Authorization: `Basic ${credentials}`, }; - await fetch(tokenUrl, { + await fetch(endpoints.tokenUrl, { method: 'POST', headers: headers, }).then(response => { @@ -43,7 +44,8 @@ export function setToken(token) { * @returns {Promise} */ export async function myInfo() { - const response = await axios.get(myInfoUrl); + setAuthorization(); + const response = await axios.get(endpoints.myInfoUrl); return response.data; } @@ -62,7 +64,7 @@ export async function register(firstName, lastName, email, password, onSucceed) password }); - await fetch(usrCreationUrl, { + await fetch(endpoints.usrCreationUrl, { method: 'POST', headers: { 'Content-Type': 'application/json' diff --git a/src/agent-builder/src/lib/services/conversation-service.js b/src/agent-builder/src/lib/services/conversation-service.js index af8af3f3..b27459bd 100644 --- a/src/agent-builder/src/lib/services/conversation-service.js +++ b/src/agent-builder/src/lib/services/conversation-service.js @@ -1,9 +1,4 @@ -import { - conversationInitUrl, - conversationsUrl, - conversationMessageUrl, - dialogsUrl, - } from './api-endpoints.js'; +import { endpoints } from './api-endpoints.js'; import { setAuthorization } from '$lib/helpers/http'; import axios from 'axios'; @@ -14,7 +9,7 @@ import axios from 'axios'; */ export async function newConversation(agentId) { setAuthorization(); - let url = conversationInitUrl.replace("{agentId}", agentId); + let url = endpoints.conversationInitUrl.replace("{agentId}", agentId); const response = await axios.post(url, {}); return response.data; } @@ -25,13 +20,25 @@ export async function newConversation(agentId) { * @returns {Promise>} */ export async function getConversations(filter) { - let url = conversationsUrl; + setAuthorization(); + let url = endpoints.conversationsUrl; const response = await axios.get(url, { params: filter }); return response.data; } +/** + * Delete conversation + * @param {string} conversationId + */ +export async function deleteConversation(conversationId) { + setAuthorization(); + let url = endpoints.conversationDeletionUrl.replace("{conversationId}", conversationId); + const response = await axios.delete(url); + return response.data; +} + /** * Get dialog history * @param {string} conversationId @@ -39,7 +46,7 @@ export async function getConversations(filter) { */ export async function GetDialogs(conversationId) { setAuthorization(); - let url = dialogsUrl.replace("{conversationId}", conversationId); + let url = endpoints.dialogsUrl.replace("{conversationId}", conversationId); const response = await axios.get(url); return response.data; } @@ -51,7 +58,7 @@ export async function GetDialogs(conversationId) { * @param {string} message The text message sent to CSR */ export async function sendMessageToHub(agentId, conversationId, message) { - let url = conversationMessageUrl.replace("{agentId}", agentId) + let url = endpoints.conversationMessageUrl.replace("{agentId}", agentId) .replace("{conversationId}", conversationId); const response = await axios.post(url, { "text": message diff --git a/src/agent-builder/src/lib/services/signalr-service.js b/src/agent-builder/src/lib/services/signalr-service.js index 029f3dab..aa7024bb 100644 --- a/src/agent-builder/src/lib/services/signalr-service.js +++ b/src/agent-builder/src/lib/services/signalr-service.js @@ -1,5 +1,5 @@ import { HubConnection, HubConnectionBuilder, LogLevel, HubConnectionState } from '@microsoft/signalr'; -import { chatHubUrl } from '$lib/services/api-endpoints.js'; +import { endpoints } from '$lib/services/api-endpoints.js'; import { getUserStore } from '$lib/helpers/store.js'; // create a writable store to store the connection object @@ -27,7 +27,7 @@ export const signalr = { // create a new connection object with the hub URL and some options let user = getUserStore(); connection = new HubConnectionBuilder() - .withUrl(chatHubUrl + `?conversationId=${conversationId}&access_token=${user.token}`) // the hub URL, change it according to your server + .withUrl(endpoints.chatHubUrl + `?conversationId=${conversationId}&access_token=${user.token}`) // the hub URL, change it according to your server .withAutomaticReconnect() // enable automatic reconnection .configureLogging(LogLevel.Information) // configure the logging level .build(); diff --git a/src/agent-builder/src/routes/(home)/+page.svelte b/src/agent-builder/src/routes/(home)/+page.svelte index 91da05db..21847fcd 100644 --- a/src/agent-builder/src/routes/(home)/+page.svelte +++ b/src/agent-builder/src/routes/(home)/+page.svelte @@ -8,7 +8,7 @@ const countdown = () => { if(browser){ // Set the date we're counting down to - var countDownDate = new Date("Dec 30, 2024").getTime(); + var countDownDate = new Date("Dec 30, 2025").getTime(); // Update the count down every 1 second var countDown = setInterval(function () { @@ -79,7 +79,7 @@
- +
diff --git a/src/agent-builder/src/routes/(pages)/conversation/+page.svelte b/src/agent-builder/src/routes/(pages)/conversation/+page.svelte index e69de29b..2768be11 100644 --- a/src/agent-builder/src/routes/(pages)/conversation/+page.svelte +++ b/src/agent-builder/src/routes/(pages)/conversation/+page.svelte @@ -0,0 +1,185 @@ + + + + + + + + + + +
+
Conversation List
+
+ + + + + + Action + Another action + Something else here + + +
+
+
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + {#each conversations.items as conv} + + + + + + + + + + + {/each} + +
TitleCustomer NameRoleChannelPosted DateLast DateStatusAction
+ {conv.title}{conv.user.full_name}{conv.user.role}{conv.channel}{format(conv.created_time, 'time')}{format(conv.updated_time, 'time')}{conv.status} +
    +
  • + handleConversationView(conv.id)} class="btn btn-sm btn-soft-primary"> + + +
  • +
  • + + + +
  • +
  • + handleConversationDeletion(conv.id)} class="btn btn-sm btn-soft-danger"> + + +
  • +
+
+
+ + + +
+
+ +
diff --git a/src/agent-builder/src/routes/VerticalLayout/Header.svelte b/src/agent-builder/src/routes/VerticalLayout/Header.svelte index 8ac030e3..0c32a47c 100644 --- a/src/agent-builder/src/routes/VerticalLayout/Header.svelte +++ b/src/agent-builder/src/routes/VerticalLayout/Header.svelte @@ -48,7 +48,7 @@ - + @@ -57,7 +57,7 @@ - +
@@ -84,16 +84,6 @@ - - - - diff --git a/src/agent-builder/src/routes/chat/[agentId]/[conversationId]/+page.svelte b/src/agent-builder/src/routes/chat/[agentId]/[conversationId]/+page.svelte index 26260db1..bef9de6e 100644 --- a/src/agent-builder/src/routes/chat/[agentId]/[conversationId]/+page.svelte +++ b/src/agent-builder/src/routes/chat/[agentId]/[conversationId]/+page.svelte @@ -22,4 +22,6 @@ }); - \ No newline at end of file +{#if currentUser } + +{/if} \ No newline at end of file diff --git a/src/agent-builder/src/routes/chat/[agentId]/[conversationId]/chat-box.svelte b/src/agent-builder/src/routes/chat/[agentId]/[conversationId]/chat-box.svelte index c77a0c61..acff4f1f 100644 --- a/src/agent-builder/src/routes/chat/[agentId]/[conversationId]/chat-box.svelte +++ b/src/agent-builder/src/routes/chat/[agentId]/[conversationId]/chat-box.svelte @@ -4,7 +4,6 @@ DropdownToggle, DropdownMenu, DropdownItem, - Form, Input, Button } from 'sveltestrap'; @@ -194,14 +193,16 @@ {:else}
avatar - {#if message.rich_content.message.rich_type == 'text'} + {#if message.rich_content && message.rich_content.message.rich_type == 'text'} - {:else if message.rich_content.message.rich_type == 'quick_reply'} + {:else if message.rich_content && message.rich_content.message.rich_type == 'quick_reply'} + {:else} + {message.text} {/if}
{/if}