1import { API_URL } from "https://esm.town/v/std/API_URL";
2import { ValTownBlobError } from "https://esm.town/v/std/ValTownBlobError";
3import { ValTownBlobNotFoundError } from "https://esm.town/v/std/ValTownBlobNotFoundError";
82async function list(prefix?: string): Promise<{ key: string; size: number; lastModified: string }[]> {
83 let querystring = prefix ? `?prefix=${encodeURIComponent(prefix)}` : "";
84 const res = await fetch(`${API_URL}/v1/blob${querystring}`, {
85 headers: {
86 Authorization: `Bearer ${Deno.env.get("valtown")}`,
95
96async function delete_(key: string) {
97 const res = await fetch(`${API_URL}/v1/blob/${encodeURIComponent(key)}`, {
98 method: "DELETE",
99 headers: {
108
109async function get(key: string) {
110 const res = await fetch(`${API_URL}/v1/blob/${encodeURIComponent(key)}`, {
111 headers: {
112 Authorization: `Bearer ${Deno.env.get("valtown")}`,
124
125async function set(key: string, value: BodyInit) {
126 const res = await fetch(`${API_URL}/v1/blob/${encodeURIComponent(key)}`, {
127 method: "POST",
128 headers: {
155 <head>
156 <title>SQLite Explorer</title>
157 <link rel="preconnect" href="https://fonts.googleapis.com" />
158 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
159 <link
160 href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
161 rel="stylesheet"
162 />
13## Authentication
14
15Login to your SQLite Explorer with [password authentication](https://www.val.town/v/pomdtr/password_auth) with your [Val Town API Token](https://www.val.town/settings/api) as the password.
16
17## Todos / Plans
11[](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
12
13It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
14
15# TODO
11[](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
12
13It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
14
15# TODO
84 const timeoutId = setTimeout(() => controller.abort(), 5000);
85
86 const response = await fetch('/api/leads', {
87 signal: controller.signal
88 });
107 const timeoutId = setTimeout(() => controller.abort(), 5000);
108
109 const response = await fetch('/api/leads', {
110 method: 'POST',
111 headers: { 'Content-Type': 'application/json' },
236 }
237
238 // Handle API routes with timeout
239 if (request.method === 'GET' && new URL(request.url).pathname === '/api/leads') {
240 try {
241 const leads = await sqlite.execute(`SELECT * FROM ${KEY}_leads ORDER BY created_at DESC LIMIT 100`);
253 }
254
255 if (request.method === 'POST' && new URL(request.url).pathname === '/api/leads') {
256 try {
257 const lead = await request.json();
201 <meta name="viewport" content="width=device-width, initial-scale=1.0">
202 <title>Talash - Futuristic AI Search</title>
203 <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&family=Orbitron:wght@400;700&display=swap" rel="stylesheet">
204 <style>${css}</style>
205 </head>
11[](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
12
13It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
14
15# TODO
43 'support', 'help', 'faq', 'contact us', 'about us', 'team', 'careers',
44 'advertise', 'partnerships', 'sponsorships', 'media kit',
45 'rss feed', 'xml', 'api', 'widget', 'embed',
46 'copyright', 'trademark', 'legal', 'disclaimer', 'terms of use', 'privacy policy'
47]);
241 <meta name="viewport" content="width=device-width, initial-scale=1.0">
242 <title>Radical Text Analyser</title>
243 <link href="https://fonts.googleapis.com/css2?family=VT323&display=swap" rel="stylesheet">
244 <script src="https://cdnjs.cloudflare.com/ajax/libs/jqcloud/1.0.4/jqcloud-1.0.4.min.js"></script>
245 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqcloud/1.0.4/jqcloud.min.css">
141 <meta name="viewport" content="width=device-width, initial-scale=1.0">
142 <title>Radical 90s Text Analyzer</title>
143 <link href="https://fonts.googleapis.com/css2?family=Comic+Neue:wght@700&display=swap" rel="stylesheet">
144 <style>${css}</style>
145 </head>