10import handleModalSubmit from "./slack/modalSubmit.ts";
1112export default async function main(req: Request) {
13const url = new URL(req.url);
14
Linear-to-Slack-ReminderlinearApi.ts2 matches
8});
910export async function getLinearTicket(ticketId: string): Promise<LinearIssue> {
11const query = `
12query IssueWithChildren($id: String!) {
69}
7071export function extractTicketId(input: string): string {
72// Handle Linear URLs like https://linear.app/team/issue/TEAM-123
73const urlMatch = input.match(/([A-Z]+-\d+)/);
Linear-to-Slack-Reminderdatabase.ts8 matches
2import { Reminder } from "./types.ts";
34export async function initDatabase() {
5await sqlite.execute(`
6CREATE TABLE IF NOT EXISTS reminders (
21}
2223export async function createReminder(reminder: Omit<Reminder, 'id'>): Promise<number> {
24const result = await sqlite.execute({
25sql: `
4748// Map SQLite row arrays to Reminder objects so it's cleaner to read
49function rowToReminder(row: any[]): Reminder {
50return {
51id: row[0],
63}
6465export async function getActiveReminders(): Promise<Reminder[]> {
66const result = await sqlite.execute("SELECT * FROM reminders WHERE active = 1");
67return result.rows.map(rowToReminder);
68}
6970export async function updateReminder(
71id: number,
72updates: Partial<Reminder>
82}
8384export async function getRemindersByCreator(creatorId: string): Promise<Reminder[]> {
85const result = await sqlite.execute({
86sql: "SELECT * FROM reminders WHERE creator_slack_id = ? AND active = 1",
91}
9293export async function getAllRemindersByCreator(creatorId: string): Promise<Reminder[]> {
94const result = await sqlite.execute({
95sql: "SELECT * FROM reminders WHERE creator_slack_id = ?",
99}
100101export async function clearAllReminders(): Promise<void> {
102await sqlite.execute("UPDATE reminders SET active = 0");
103}
Linear-to-Slack-Remindercron.ts4 matches
21* Orchestrates the daily reminder check. This is the main cron entrypoint.
22*/
23export default async function checkReminders() {
24const TESTING = true; // TODO: change this to false to put this into production
2555}
5657function shouldProcessReminder(
58reminder: Reminder,
59now: Date,
67}
6869function buildSummary(
70runTimestamp: string,
71totalChecked: number,
80}
8182async function processReminder(reminder: Reminder): Promise<number> {
83console.log(`\n --- Processing ${reminder.ticket_title} ---`);
84
34};
3536// Utility function for password hashing
37async function hashPassword(password: string): Promise<string> {
38const encoder = new TextEncoder();
39const data = encoder.encode(password);
4546// Main App Component
47function App() {
48const [user, setUser] = useState<any>(null);
49const [view, setView] = useState("home");
15961597// Client-side rendering
1598function client() {
1599const rootElement = document.getElementById("root");
1600if (rootElement) {
1609}
16101611// Server-side functions
1612export default async function server(request: Request) {
1613try {
1614const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
Sonarfarcaster.ts3 matches
8// export const ogImageUrl = "https://imgur.com/xKVOVUE.png";
910export function embedMetadata(baseUrl: string, path: string = '/') {
11return {
12version: 'next',
25}
2627export function handleFarcasterEndpoints(app: Hono) {
28app.get('/.well-known/farcaster.json', (c) => {
29const baseUrl = c.req.url.replace(c.req.path, '')
84const decodeBase64Json = (str: string) => JSON.parse(Buffer.from(str, 'base64').toString('utf-8'))
8586async function sendWelcomeNotification(fid: number, baseUrl: string) {
87return await sendNotificationToUser(fid, {
88title: name + ' installed!',
FarcasterSpacesfarcaster.ts3 matches
7// export const ogImageUrl = "https://imgur.com/oLCWKFI.png";
89export function embedMetadata(baseUrl: string, path: string = '/') {
10const channel = path?.startsWith('/space/') ? path.replace('/space/', '') : ''
11return {
25}
2627export function handleFarcasterEndpoints(app: Hono) {
28app.get('/.well-known/farcaster.json', (c) => {
29const baseUrl = c.req.url.replace(c.req.path, '')
81const decodeBase64Json = (str: string) => JSON.parse(Buffer.from(str, 'base64').toString('utf-8'))
8283async function sendWelcomeNotification(fid: number, baseUrl: string) {
84return await sendNotificationToUser(fid, {
85title: `Welcome to ${name}!`,
13import { ChannelScreen, ChannelFeed, ChannelDebug, ChannelMedia, ChannelStats } from './screens/ChannelScreen.tsx'
1415export function App() {
16const [context, setContext] = useState<any>()
17useEffect(() => {
73}
7475function About() {
76return (
77<Section className="flex flex-col items-start gap-3 m-5">
4import { useParams, Outlet, NavLink } from 'https://esm.sh/react-router@7'
56export function Section({ children, ...props }: any) {
7const sectionClass = `p-5 rounded-3xl bg-neutral-400/15 ${props.className || ''}`
8return <div className={sectionClass}>{children}</div>
94}
9596// export function Input(props: any) {
97// const inputClass = "dark:bg-white dark:text-black bg-black text-white rounded-md px-3 py-1 ";
98// return <input class={inputClass} {...props} />;
99// }
100101// export function Button(props: any) {
102// const buttonClass = "dark:bg-white dark:text-black bg-black text-white rounded-md px-3 py-1 ";
103// return <button class={buttonClass} {...props} />;
104// }
105106export function MonoButton(props: any) {
107return (
108<Button {...props}>
112}
113114export function MonoButtonWithStatus(props: any) {
115const [status, setStatus] = useState<any>()
116const handleClick = async () => {
133}
134135export function Separator({ className = '' }) {
136return <div className={`border-b border-neutral-400/25 ${className}`}></div>
137}
138139export function PaddedSpinner() {
140return (
141<div className="flex flex-row items-center justify-center p-4 opacity-50 h-32">
145}
146147export function PaddedError({ message }) {
148return (
149<div className="flex flex-row items-center justify-center p-4 opacity-50 h-32">
153}
154155export function StatsRows({ stats }) {
156return (
157<div className="flex flex-col ">
169}
170171export function Debug({ data, className = '' }) {
172return <pre className={'whitespace-pre-wrap break-all text-xs ' + className}>{JSON.stringify(data, null, 2)}</pre>
173}
174175export function NavTabs({ navLinks }) {
176return (
177<>
198//////////
199200export function formatJSON(json: any) {
201return JSON.stringify(json, null, 2)
202}
226}
227228export function BackButton({}) {
229return <ArrowLeft className="w-5 h-5 m-2 cursor-pointer opacity-50" onClick={() => (window.location.href = '/')} />
230}
231232export function ShareButton({ onClick }) {
233return <Share className="w-5 h-5 m-2 cursor-pointer opacity-50" onClick={onClick} />
234}
reactHonoStarterApp.tsx1 match
2import { useState } from "https://esm.sh/react@18.2.0";
34export function App() {
5const [clicked, setClicked] = useState(0);
6return (