Skip to content

Commit

Permalink
Merge branch 'develop' into dependabot/npm_and_yarn/apps/api-gateway/…
Browse files Browse the repository at this point in the history
…express-4.19.2
  • Loading branch information
mikepsinn authored Apr 1, 2024
2 parents 9fa8af6 + 5bb17be commit 1ab03f6
Show file tree
Hide file tree
Showing 77 changed files with 2,634 additions and 4,520 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ litellm_uuid.txt
.space
.makemd
desktop.ini
coverage/
/apps/js-examples/data
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@
"gulptasks.notifications.restarted": true,
"fiveServer.navigate": true,
"editor.acceptSuggestionOnEnter": "on",
"eslint.validate": ["json"]
"eslint.validate": [
"json"
],
"WillLuke.nextjs.addTypesOnSave": true,
"WillLuke.nextjs.hasPrompted": true
}
3 changes: 2 additions & 1 deletion apps/api-gateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"@mermaid-js/mermaid-cli": "^9.2.2",
"prisma": "^4.6.1",
"prisma-dbml-generator": "^0.12.0",
"prisma-erd-generator": "^1.2.4"
"prisma-erd-generator": "^1.2.4",
"supertest": "^6.3.4"
}
}
20 changes: 20 additions & 0 deletions apps/api-gateway/tests/userRouterTest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const request = require('supertest');
const express = require('express');
const app = express();
const router = require('../index'); // replace with your router path

app.use(express.json());
app.use('/', router);

test('POST /users', async () => {
const mockRequest = {
uuid: 'test-uuid', // replace with your test uuid
};

const response = await request(app)
.post('/users')
.send(mockRequest);

expect(response.statusCode).toBe(200);
// Add more assertions based on the expected response
});
62 changes: 62 additions & 0 deletions apps/chat-widget/chat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
function createChatWindow() {
var chatWindow = document.createElement('div');
chatWindow.id = 'chat-window';
chatWindow.style.cssText = `
position: fixed;
right: 20px;
bottom: 80px; /* Adjusted to make room for the floating button */
width: 300px;
height: 400px;
border: 1px solid #ccc;
z-index: 1000;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
display: none; /* Initially hidden */
`;
document.body.appendChild(chatWindow);
}

// Function to open the chat iframe within the chat window
function openChat() {
var iframe = document.createElement('iframe');
iframe.src = "https://certainly-inspired-duck.ngrok-free.app/chat";
iframe.style.width = "100%";
iframe.style.height = "100%";
iframe.style.border = "none";

var chatWindow = document.getElementById('chat-window');
chatWindow.innerHTML = ""; // Clear the container
chatWindow.appendChild(iframe);
chatWindow.style.display = "block"; // Show the chat window
}

// Function to toggle the visibility of the chat window
function toggleChat() {
var chatWindow = document.getElementById('chat-window');
if (chatWindow.style.display === "none") {
openChat();
} else {
chatWindow.style.display = "none";
}
}

// Function to create and style the floating button
function createFloatingButton() {
var buttonImg = document.createElement('img');
buttonImg.src = "https://fdai.earth/wp-content/uploads/2024/03/robot-head.png";
buttonImg.style.cssText = `
position: fixed;
right: 20px;
bottom: 20px;
width: 60px; /* Adjust the size as needed */
height: auto;
cursor: pointer;
z-index: 1001; /* Ensure it's above the chat window */
`;
buttonImg.onclick = toggleChat;

document.body.appendChild(buttonImg);
}

// Initialize the chat window and floating button
createChatWindow();
createFloatingButton();
61 changes: 0 additions & 61 deletions apps/chat-widget/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,68 +23,7 @@

<script>
// Function to create and style the chat window
function createChatWindow() {
var chatWindow = document.createElement('div');
chatWindow.id = 'chat-window';
chatWindow.style.cssText = `
position: fixed;
right: 20px;
bottom: 80px; /* Adjusted to make room for the floating button */
width: 300px;
height: 400px;
border: 1px solid #ccc;
z-index: 1000;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
display: none; /* Initially hidden */
`;
document.body.appendChild(chatWindow);
}

// Function to open the chat iframe within the chat window
function openChat() {
var iframe = document.createElement('iframe');
iframe.src = "https://certainly-inspired-duck.ngrok-free.app/chat";
iframe.style.width = "100%";
iframe.style.height = "100%";
iframe.style.border = "none";

var chatWindow = document.getElementById('chat-window');
chatWindow.innerHTML = ""; // Clear the container
chatWindow.appendChild(iframe);
chatWindow.style.display = "block"; // Show the chat window
}

// Function to toggle the visibility of the chat window
function toggleChat() {
var chatWindow = document.getElementById('chat-window');
if (chatWindow.style.display === "none") {
openChat();
} else {
chatWindow.style.display = "none";
}
}

// Function to create and style the floating button
function createFloatingButton() {
var buttonImg = document.createElement('img');
buttonImg.src = "https://fdai.earth/wp-content/uploads/2024/03/robot-head.png";
buttonImg.style.cssText = `
position: fixed;
right: 20px;
bottom: 20px;
width: 60px; /* Adjust the size as needed */
height: auto;
cursor: pointer;
z-index: 1001; /* Ensure it's above the chat window */
`;
buttonImg.onclick = toggleChat;

document.body.appendChild(buttonImg);
}

// Initialize the chat window and floating button
createChatWindow();
createFloatingButton();
</script>

</body>
Expand Down
Loading

0 comments on commit 1ab03f6

Please sign in to comment.