untitled-7712queries.ts7 matches
3738// User queries
39export async function getUsers(): Promise<User[]> {
40const result = await sqlite.execute(`SELECT * FROM ${USERS_TABLE} ORDER BY created_at DESC`);
41return result.rows as User[];
42}
4344export async function getUserByUsername(username: string): Promise<User | null> {
45const result = await sqlite.execute(
46`SELECT * FROM ${USERS_TABLE} WHERE username = ?`,
50}
5152export async function createUser(username: string): Promise<User> {
53const result = await sqlite.execute(
54`INSERT INTO ${USERS_TABLE} (username) VALUES (?) RETURNING *`,
5960// Job queries
61export async function getJobs(): Promise<Job[]> {
62const result = await sqlite.execute(`SELECT * FROM ${JOBS_TABLE} ORDER BY created_at DESC`);
63return result.rows as Job[];
64}
6566export async function createJob(job: JobInput): Promise<Job> {
67const result = await sqlite.execute(
68`INSERT INTO ${JOBS_TABLE} (title, company, description, location, contact_email, posted_by)
7475// Message queries
76export async function getMessages(limit: number = 50): Promise<Message[]> {
77const result = await sqlite.execute(
78`SELECT * FROM ${MESSAGES_TABLE} ORDER BY created_at DESC LIMIT ?`,
82}
8384export async function createMessage(content: string, username: string): Promise<Message> {
85const result = await sqlite.execute(
86`INSERT INTO ${MESSAGES_TABLE} (content, username) VALUES (?, ?) RETURNING *`,
untitled-7712migrations.ts1 match
6const MESSAGES_TABLE = "job_board_messages";
78export async function initDatabase() {
9// Create users table
10await sqlite.execute(`
pass-genpassword-generator.ts17 matches
1export default async function (req: Request) {
2// Fetch a password from dinopass.com on the server side to avoid CORS issues
3let dinoPassword = "";
130]);
131
132// Function to check if a string is a known word
133function isKnownWord(word) {
134return allWords.has(word.toLowerCase());
135}
136
137// Function to check if a string ends with a known adjective ending in 'y'
138function endsWithAdjectiveY(str) {
139str = str.toLowerCase();
140return wordDictionary.adjectivesY.some(adj => str.endsWith(adj));
141}
142
143// Function to check if a string contains a color word
144function containsColorWord(str) {
145str = str.toLowerCase();
146return wordDictionary.colors.some(color => str.includes(color));
147}
148
149// Function to check if a string contains an animal word
150function containsAnimalWord(str) {
151str = str.toLowerCase();
152return wordDictionary.animals.some(animal => str.includes(animal));
153}
154
155// Function to extract whole words from dinopass response
156function extractWords(password) {
157// Remove any numbers or special characters
158const cleanPassword = password.replace(/[^a-zA-Z]/g, '').toLowerCase();
232}
233
234// Function to capitalize first letter
235function capitalize(word) {
236return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
237}
238
239// Function to generate password
240async function generatePassword() {
241try {
242// Show loading state
271}
272
273// Function to copy password to clipboard
274function copyToClipboard() {
275const passwordField = document.getElementById('passwordField');
276if (!passwordField.value) return;
9- Extracts whole words from the dinopass response
10- Capitalizes the first letter of each word
11- Modern UI with a copy-to-clipboard function
12- Responsive design that works on all devices
13
untitled-2444index.ts14 matches
4748// Set up the form submission handler
49function setupFormHandling(
50tokenizer: Tokenizer,
51scriptEditor: ScriptEditor,
264265// Set up the token counter
266function setupTokenCounter(tokenizer: Tokenizer) {
267const textArea = document.getElementById("text") as HTMLTextAreaElement;
268const tokenCount = document.getElementById("tokenCount") as HTMLSpanElement;
296297// Set up template selector
298function setupTemplateSelector(templateManager: TemplateManager) {
299const templateSelect = document.getElementById("templateSelect") as HTMLSelectElement;
300const instructionsTextarea = document.getElementById("instructions") as HTMLTextAreaElement;
314315// Set up advanced options
316function setupAdvancedOptions(openAIConnector: OpenAIConnector, debugConsole: DebugConsole) {
317const advancedOptionsBtn = document.getElementById("advancedOptionsBtn") as HTMLButtonElement;
318const advancedOptions = document.getElementById("advancedOptions") as HTMLDivElement;
417418// Set up result actions (copy, download, compare)
419function setupResultActions(scriptEditor: ScriptEditor, textFormatter: TextFormatter) {
420const copyBtn = document.getElementById("copyBtn") as HTMLButtonElement;
421const downloadBtn = document.getElementById("downloadBtn") as HTMLButtonElement;
604605// Set up history modal
606function setupHistoryModal(historyManager: HistoryManager, scriptEditor: ScriptEditor) {
607const historyBtn = document.getElementById("historyBtn") as HTMLButtonElement;
608const historyModal = document.getElementById("historyModal") as HTMLDivElement;
674675// Set up utility buttons (load sample, clear)
676function setupUtilityButtons(scriptEditor: ScriptEditor) {
677const loadSampleBtn = document.getElementById("loadSampleBtn") as HTMLButtonElement;
678const clearBtn = document.getElementById("clearBtn") as HTMLButtonElement;
704705// Set up script type detection
706function setupScriptTypeDetection(tokenizer: Tokenizer) {
707const textArea = document.getElementById("text") as HTMLTextAreaElement;
708const scriptTypeDetected = document.getElementById("scriptTypeDetected") as HTMLSpanElement;
757/**
758* Create a prompt based on script type
759* This is a duplicate of the server-side function to enable direct API calls
760*/
761function createPromptForScriptType(
762chunk: string,
763instructions: string,
859860// Set up word counter
861function setupWordCounter(textFormatter: TextFormatter) {
862const textArea = document.getElementById("text") as HTMLTextAreaElement;
863const wordCount = document.getElementById("wordCount") as HTMLSpanElement;
879880// Set up share modal
881function setupShareModal() {
882const shareModal = document.getElementById("shareModal") as HTMLDivElement;
883const closeShareBtn = document.getElementById("closeShareBtn") as HTMLButtonElement;
955956// Set up feedback modal
957function setupFeedbackModal() {
958const feedbackModal = document.getElementById("feedbackModal") as HTMLDivElement;
959const closeFeedbackBtn = document.getElementById("closeFeedbackBtn") as HTMLButtonElement;
10231024// Set up export/import settings
1025function setupExportImportSettings() {
1026const exportSettingsBtn = document.getElementById("exportSettingsBtn") as HTMLButtonElement;
1027const importSettingsBtn = document.getElementById("importSettingsBtn") as HTMLButtonElement;
42import { Drawer } from "https://esm.sh/vaul?deps=react@18.2.0,react-dom@18.2.0";
4344function SideDrawer({ trigger, title, content, initialOpen = false }: {
45trigger: React.JSX.Element;
46title: string;
74}
7576function BottomDrawer({ trigger, title, content, initialOpen = false }: {
77trigger: React.JSX.Element;
78title: string;
279};
280281function ProductCard(
282{ db, cart, product, activeProductId, setActiveProductId }: {
283db: any;
439}
440441function ProductCarousel({ children }: { children: React.ReactNode }) {
442const [emblaRef, emblaApi] = useEmblaCarousel({
443axis: "x",
470const scrollResult = emblaApi.scrollTo(emblaApi.selectedScrollSnap() + Math.sign(delta));
471472if (scrollResult && typeof scrollResult.then === "function") {
473scrollResult.then(() => {
474isScrollingRef.current = false;
10921093// Client-side rendering
1094function client() {
1095const root = document.getElementById("root");
1096if (root) {
1111const app = new Hono();
11121113// Server-side rendering function
1114const renderPage = () => {
1115const content = renderToString(
createInteractionForm.tsx1 match
7}
89export default function InteractionForm({ onSubmit }: InteractionFormProps) {
10const [formData, setFormData] = useState<Omit<Interaction, 'contact_id'>>({
11type: 'call' as InteractionType,
createContactDetail.tsx1 match
11}
1213export default function ContactDetail({
14contact,
15onEdit,
createContactForm.tsx1 match
8}
910export default function ContactForm({ contact, onSubmit }: ContactFormProps) {
11const [formData, setFormData] = useState<Contact>({
12id: contact?.id,
createContactList.tsx1 match
9}
1011export default function ContactList({
12contacts,
13selectedContactId,