import { Pool } from "pg";
async function keyFor(pool: Pool, name: string): Promise<string> {
const { rows } = await pool.query<{ key: string }>(
"SELECT hashtextextended($1, 0) AS key",
[name]
import { useCallback, useEffect, useState } from "react";
type Patch = Record<string, string | null | undefined>;
function readParams(): URLSearchParams {
return new URLSearchParams(window.location.search);
import { Suspense } from 'react'
import { useSuspenseQuery } from '@tanstack/react-query'
import { useParams } from 'react-router-dom'
import api from '@/services/api'
import { Post } from '@/types'
import { ErrorBoundary } from '@/components/ErrorBoundary'
import { ReactNode, useEffect, useState } from 'react'
import { createPortal } from 'react-dom'
interface PortalProps {
children: ReactNode
container?: Element
import { CanDeactivateFn } from '@angular/router';
import { Observable } from 'rxjs';
export interface HasUnsavedChanges {
canDeactivate(): boolean | Observable<boolean>;
}
import { Link, useLocation, useMatches } from 'react-router-dom'
interface BreadcrumbMatch {
pathname: string
handle?: {
crumb?: (data?: any) => string
import { cookies } from "next/headers";
import { jwtVerify } from "jose";
export interface Session {
userId: string;
role: "user" | "admin";
export const PERMISSIONS = {
READ_POSTS: 'posts:read',
WRITE_POSTS: 'posts:write',
DELETE_POSTS: 'posts:delete',
MANAGE_USERS: 'users:manage',
} as const;
export interface Todo {
id: string;
title: string;
done: boolean;
}
import { Readable } from "node:stream";
import { S3Client } from "@aws-sdk/client-s3";
import { Upload } from "@aws-sdk/lib-storage";
const s3 = new S3Client({ region: process.env.AWS_REGION });
const BUCKET = process.env.UPLOAD_BUCKET!;
import React, { createContext, useContext, useState, ReactNode } from 'react'
interface TabsContextType {
activeTab: string
setActiveTab: (tab: string) => void
}
import { Injectable, signal, computed } from '@angular/core';
export interface CurrentUser {
id: string;
email: string;
roles: string[];