20const session2 = await createCallsSession();
2122const channel1resp = await fetch(
23`${API_BASE}/sessions/${session1.sessionId}/datachannels/new`,
24{
44);
4546const channel1SubscribeResp = await fetch(
47`${API_BASE}/sessions/${session2.sessionId}/datachannels/new`,
48{
135await peerConnection.createOffer(),
136);
137const { sessionId, sessionDescription } = await fetch(
138`${API_BASE}/sessions/new`,
139{
blob_adminmain.tsx1 match
199});
200201export default lastlogin((request: Request) => app.fetch(request));
blob_adminapp.tsx22 matches
231const [isDragging, setIsDragging] = useState(false);
232233const fetchBlobs = useCallback(async () => {
234setLoading(true);
235try {
236const response = await fetch(`/api/blobs?prefix=${encodeKey(searchPrefix)}&limit=${limit}`);
237const data = await response.json();
238setBlobs(data);
239} catch (error) {
240console.error("Error fetching blobs:", error);
241} finally {
242setLoading(false);
245246useEffect(() => {
247fetchBlobs();
248}, [fetchBlobs]);
249250const handleSearch = (e) => {
261setBlobContentLoading(true);
262try {
263const response = await fetch(`/api/blob?key=${encodeKey(clickedBlob.key)}`);
264const content = await response.text();
265setSelectedBlob({ ...clickedBlob, key: decodeKey(clickedBlob.key) });
266setEditContent(content);
267} catch (error) {
268console.error("Error fetching blob content:", error);
269} finally {
270setBlobContentLoading(false);
275const handleSave = async () => {
276try {
277await fetch(`/api/blob?key=${encodeKey(selectedBlob.key)}`, {
278method: "PUT",
279body: editContent,
287const handleDelete = async (key) => {
288try {
289await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
290setBlobs(blobs.filter(b => b.key !== key));
291if (selectedBlob && selectedBlob.key === key) {
304const key = `${searchPrefix}${file.name}`;
305formData.append("key", encodeKey(key));
306await fetch("/api/blob", { method: "POST", body: formData });
307const newBlob = { key, size: file.size, lastModified: new Date().toISOString() };
308setBlobs([newBlob, ...blobs]);
312}
313}
314fetchBlobs();
315};
316326try {
327const fullKey = `${searchPrefix}${key}`;
328await fetch(`/api/blob?key=${encodeKey(fullKey)}`, {
329method: "PUT",
330body: "",
341const handleDownload = async (key) => {
342try {
343const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
344const blob = await response.blob();
345const url = window.URL.createObjectURL(blob);
360if (newKey && newKey !== oldKey) {
361try {
362const response = await fetch(`/api/blob?key=${encodeKey(oldKey)}`);
363const content = await response.blob();
364await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
365method: "PUT",
366body: content,
367});
368await fetch(`/api/blob?key=${encodeKey(oldKey)}`, { method: "DELETE" });
369setBlobs(blobs.map(b => b.key === oldKey ? { ...b, key: newKey } : b));
370if (selectedBlob && selectedBlob.key === oldKey) {
380const newKey = `__public/${key}`;
381try {
382const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
383const content = await response.blob();
384await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
385method: "PUT",
386body: content,
387});
388await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
389setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
390if (selectedBlob && selectedBlob.key === key) {
399const newKey = key.slice(9); // Remove "__public/" prefix
400try {
401const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
402const content = await response.blob();
403await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
404method: "PUT",
405body: content,
406});
407await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
408setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
409if (selectedBlob && selectedBlob.key === key) {
12const telegramApiUrl = `https://api.telegram.org/bot${botToken}/sendMessage`;
1314const response = await fetch(telegramApiUrl, {
15method: 'POST',
16headers: {
Towniesend-message.ts3 matches
87}
8889// If there are selected files, fetch their content and add them to the messages
90if (selectedFiles && selectedFiles.length > 0) {
91const vt = new ValTown({ bearerToken });
107fileContents += `## File: ${filePath}\n\`\`\`\n${fileWithLinesNumbers(content)}\n\`\`\`\n\n`;
108} catch (error) {
109console.error(`Error fetching file ${filePath}:`, error);
110fileContents += `## File: ${filePath}\nError: Could not fetch file content\n\n`;
111}
112}
Townieusage-dashboard.ts3 matches
59// If we get here, authentication was successful
6061// Fetch all rows from the usage table
62// Fetch all rows from the usage table
63const allUsageData = await sqlite.execute(`SELECT * FROM ${USAGE_TABLE} ORDER BY timestamp DESC`);
6465// Fetch aggregated data grouped by user_id
66const groupedUsageData = await sqlite.execute(`
67SELECT
6const botToken = process.env.TELEGRAM_BOT_TOKEN;
78const response = await fetch(`https://api.telegram.org/bot${botToken}/getWebhookInfo`);
9const result = await response.json();
10return result;
blob_adminmain.tsx1 match
199});
200201export default lastlogin((request: Request) => app.fetch(request));
blob_adminapp.tsx22 matches
231const [isDragging, setIsDragging] = useState(false);
232233const fetchBlobs = useCallback(async () => {
234setLoading(true);
235try {
236const response = await fetch(`/api/blobs?prefix=${encodeKey(searchPrefix)}&limit=${limit}`);
237const data = await response.json();
238setBlobs(data);
239} catch (error) {
240console.error("Error fetching blobs:", error);
241} finally {
242setLoading(false);
245246useEffect(() => {
247fetchBlobs();
248}, [fetchBlobs]);
249250const handleSearch = (e) => {
261setBlobContentLoading(true);
262try {
263const response = await fetch(`/api/blob?key=${encodeKey(clickedBlob.key)}`);
264const content = await response.text();
265setSelectedBlob({ ...clickedBlob, key: decodeKey(clickedBlob.key) });
266setEditContent(content);
267} catch (error) {
268console.error("Error fetching blob content:", error);
269} finally {
270setBlobContentLoading(false);
275const handleSave = async () => {
276try {
277await fetch(`/api/blob?key=${encodeKey(selectedBlob.key)}`, {
278method: "PUT",
279body: editContent,
287const handleDelete = async (key) => {
288try {
289await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
290setBlobs(blobs.filter(b => b.key !== key));
291if (selectedBlob && selectedBlob.key === key) {
304const key = `${searchPrefix}${file.name}`;
305formData.append("key", encodeKey(key));
306await fetch("/api/blob", { method: "POST", body: formData });
307const newBlob = { key, size: file.size, lastModified: new Date().toISOString() };
308setBlobs([newBlob, ...blobs]);
312}
313}
314fetchBlobs();
315};
316326try {
327const fullKey = `${searchPrefix}${key}`;
328await fetch(`/api/blob?key=${encodeKey(fullKey)}`, {
329method: "PUT",
330body: "",
341const handleDownload = async (key) => {
342try {
343const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
344const blob = await response.blob();
345const url = window.URL.createObjectURL(blob);
360if (newKey && newKey !== oldKey) {
361try {
362const response = await fetch(`/api/blob?key=${encodeKey(oldKey)}`);
363const content = await response.blob();
364await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
365method: "PUT",
366body: content,
367});
368await fetch(`/api/blob?key=${encodeKey(oldKey)}`, { method: "DELETE" });
369setBlobs(blobs.map(b => b.key === oldKey ? { ...b, key: newKey } : b));
370if (selectedBlob && selectedBlob.key === oldKey) {
380const newKey = `__public/${key}`;
381try {
382const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
383const content = await response.blob();
384await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
385method: "PUT",
386body: content,
387});
388await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
389setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
390if (selectedBlob && selectedBlob.key === key) {
399const newKey = key.slice(9); // Remove "__public/" prefix
400try {
401const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
402const content = await response.blob();
403await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
404method: "PUT",
405body: content,
406});
407await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
408setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
409if (selectedBlob && selectedBlob.key === key) {
untitled-2604new-file-9513.tsx3 matches
118
119try {
120const response = await fetch(url, {
121method: 'POST',
122headers: {
177
178try {
179const response = await fetch(url, {
180method: 'POST',
181headers: {
507
508// Enviar solicitud
509const response = await fetch(endpointUrl, {
510method: 'POST',
511headers: {