Appkyqueries.ts14 matches
45// User queries
6export async function getUserByEmail(email: string): Promise<User | null> {
7const result = await sqlite.execute(
8`SELECT * FROM ${USERS_TABLE} WHERE email = ?`,
13}
1415export async function getUserById(id: number): Promise<User | null> {
16const result = await sqlite.execute(
17`SELECT * FROM ${USERS_TABLE} WHERE id = ?`,
22}
2324export async function createUser(user: Omit<User, 'id' | 'created_at'>): Promise<number> {
25const result = await sqlite.execute(
26`INSERT INTO ${USERS_TABLE} (email, password_hash, name, preferences)
3435// Agency queries
36export async function getAllAgencies(): Promise<Agency[]> {
37const result = await sqlite.execute(`SELECT * FROM ${AGENCIES_TABLE}`);
38return result.rows as Agency[];
39}
4041export async function getAgencyById(id: number): Promise<Agency | null> {
42const result = await sqlite.execute(
43`SELECT * FROM ${AGENCIES_TABLE} WHERE id = ?`,
4950// Travel package queries
51export async function getAllPackages(limit = 20, offset = 0): Promise<TravelPackage[]> {
52const result = await sqlite.execute(
53`SELECT p.*, a.name as agency_name
62}
6364export async function getPackageById(id: number): Promise<TravelPackage | null> {
65const result = await sqlite.execute(
66`SELECT p.*, a.name as agency_name
74}
7576export async function searchPackages(params: SearchParams): Promise<TravelPackage[]> {
77let query = `
78SELECT p.*, a.name as agency_name
126}
127128export async function getFeaturedPackages(limit = 6): Promise<TravelPackage[]> {
129const result = await sqlite.execute(
130`SELECT p.*, a.name as agency_name
141142// Booking queries
143export async function createBooking(booking: Omit<Booking, 'id' | 'booking_date'>): Promise<number> {
144const result = await sqlite.execute(
145`INSERT INTO ${BOOKINGS_TABLE} (
162}
163164export async function getBookingById(id: number): Promise<Booking | null> {
165const result = await sqlite.execute(
166`SELECT b.*, p.title as package_title, p.destination, p.image_url, p.start_date, p.end_date
174}
175176export async function getUserBookings(userId: number): Promise<Booking[]> {
177const result = await sqlite.execute(
178`SELECT b.*, p.title as package_title, p.destination, p.image_url, p.start_date, p.end_date
187}
188189export async function updateBookingStatus(id: number, status: string, paymentId?: string): Promise<boolean> {
190const updateFields = paymentId
191? `status = ?, payment_id = ?, payment_status = 'completed'`
207208// Update available spots when booking is confirmed
209export async function updatePackageAvailability(packageId: number, travelerCount: number): Promise<boolean> {
210const result = await sqlite.execute(
211`UPDATE ${PACKAGES_TABLE}
Appkymigrations.ts2 matches
7export const BOOKINGS_TABLE = "travel_bookings_v1";
89export async function runMigrations() {
10// Users table
11await sqlite.execute(`
76}
7778async function insertSampleData() {
79// Check if we already have sample data
80const agencyCount = await sqlite.execute(`SELECT COUNT(*) as count FROM ${AGENCIES_TABLE}`);
17โ โโโ database/
18โ โ โโโ migrations.ts # Schema definitions
19โ โ โโโ queries.ts # DB query functions
20โ โโโ routes/ # API route handlers
21โ โ โโโ agencies.ts # Agency-related endpoints
31โ โ โโโ Header.tsx # Navigation header
32โ โ โโโ PackageCard.tsx # Travel package display card
33โ โ โโโ SearchForm.tsx # Search functionality
34โ โ โโโ BookingFlow.tsx # Booking and payment process
35โ โโโ index.html # Main HTML template
37โโโ shared/
38โโโ types.ts # Shared type definitions
39โโโ utils.ts # Shared utility functions
40```
41
LiveStormMCPREADME.md1 match
2122- `index.ts`: Main entry point with HTTP trigger
23- `livestormApi.ts`: Functions to fetch and parse the OpenAPI definition
24- `mcp.ts`: MCP server setup and configuration
redditwatcherREADME.md2 matches
42- Value: Your SERP API key.
4344Without this key, the val will not function correctly.
4546---
58- Key: `mentionsDiscord`
59- Value: Your Discord webhook URL.
60Notifications will be sent using this function:
61```
62await discordWebhook({
redditwatchermain.tsx1 match
12const isProd = true;
1314export async function redditAlert({ lastRunAt }: Interval) {
15if (!SERP_API_KEY || !DISCORD_API_KEY) {
16console.error("Missing SERP_API_KEY or Discord webhook URL. Exiting.");
templateRedditAlertREADME.md2 matches
42- Value: Your SERP API key.
4344Without this key, the val will not function correctly.
4546---
58- Key: `mentionsDiscord`
59- Value: Your Discord webhook URL.
60Notifications will be sent using this function:
61```
62await discordWebhook({
templateRedditAlertmain.tsx1 match
12const isProd = true;
1314export async function redditAlert({ lastRunAt }: Interval) {
15if (!SERP_API_KEY || !DISCORD_API_KEY) {
16console.error("Missing SERP_API_KEY or Discord webhook URL. Exiting.");
EEPPortaltaskDashboard.tsx4 matches
119const [isChangingStatus, setIsChangingStatus] = useState<number | null>(null);
120121// --- Function: Fetch Employees ---
122// This is needed for the Assignee/Manager dropdowns in create/edit forms and the assignee filter (for admin)
123const fetchEmployees = async () => {
215}, []);
216217// --- Helper function to get employee name by ID ---
218const employeeMap = useMemo(() => {
219const map = new Map<number, Employee>();
534};
535536// Handler function for selecting a task to view details
537const handleTaskSelect = (task: Task) => {
538if (editingTask) {
547};
548549// Handler function for closing the task details view
550const handleCloseDetails = () => {
551setSelectedTask(null);
untitled-9291Footer.tsx1 match
17<h3 className="text-xl font-semibold mb-4">IDES INTERIOR</h3>
18<p className="text-gray-400 mb-4">
19Creating beautiful, functional spaces that enhance people's lives.
20</p>
21{projectInfo.url && (