Louoauth_handler.tsx2 matches
62});
6364const response = await fetch(tokenUrl, {
65method: "POST",
66headers: {
103});
104105const response = await fetch(tokenUrl, {
106method: "POST",
107headers: {
61. Remix this val
72. Receive updates every time your favorite blog posts, by switching out this URL in the val:
8`await fetch("https://seths.blog/feed/");`
SethGodinNewBlogPostNotifiermain.tsx2 matches
3export default async function (interval: Interval) {
4try {
5const response = await fetch("https://seths.blog/feed/");
6const feedText = await response.text();
722});
23} catch (error) {
24console.error("Error fetching or processing feed:", error);
25}
26}
factoid-triviaApp.tsx19 matches
40}, []);
4142const fetchGameState = async () => {
43try {
44const response = await fetch('/api/game-state');
45if (response.ok) {
46const newGameState = await response.json();
58}
59} catch (err) {
60console.error('Failed to fetch game state:', err);
61}
62};
64const startPolling = () => {
65if (pollIntervalRef.current) return;
66pollIntervalRef.current = setInterval(fetchGameState, 2000); // Poll every 2 seconds
67};
6879
80try {
81const response = await fetch('/api/join', {
82method: 'POST',
83headers: { 'Content-Type': 'application/json' },
112
113try {
114const response = await fetch('/api/submit-fact', {
115method: 'POST',
116headers: { 'Content-Type': 'application/json' },
121
122if (response.ok) {
123await fetchGameState(); // Refresh game state
124} else {
125setError(data.error || 'Failed to submit fact');
138
139try {
140const response = await fetch('/api/start-round', {
141method: 'POST',
142headers: { 'Content-Type': 'application/json' },
146
147if (response.ok) {
148await fetchGameState(); // Refresh game state
149} else {
150setError(data.error || 'Failed to start round');
165
166try {
167const response = await fetch('/api/vote', {
168method: 'POST',
169headers: { 'Content-Type': 'application/json' },
178
179if (response.ok) {
180await fetchGameState(); // Refresh game state
181} else {
182setError(data.error || 'Failed to cast vote');
194
195try {
196const response = await fetch('/api/reveal', {
197method: 'POST',
198headers: { 'Content-Type': 'application/json' },
202
203if (response.ok) {
204await fetchGameState(); // Refresh game state
205} else {
206setError(data.error || 'Failed to reveal answers');
216
217try {
218const response = await fetch('/api/skip', {
219method: 'POST',
220headers: { 'Content-Type': 'application/json' },
224
225if (response.ok) {
226await fetchGameState(); // Refresh game state
227} else {
228setError(data.error || 'Failed to skip round');
238
239try {
240await fetch('/api/leave', {
241method: 'POST',
242headers: { 'Content-Type': 'application/json' },
247setUserVote(null);
248stopPolling();
249await fetchGameState();
250} catch (err) {
251console.error('Leave error:', err);
262
263try {
264const response = await fetch('/api/admin/kick-all', {
265method: 'POST',
266headers: { 'Content-Type': 'application/json' },
277
278// Refresh game state
279await fetchGameState();
280
281alert('All players have been kicked and game data cleared.');
factoid-triviaindex.ts1 match
228});
229230export default app.fetch;
tuempresaupdateSatCatalogsBlob.tsx2 matches
1import { blob } from "https://esm.town/v/std/blob";
2import { fetch } from "https://esm.town/v/std/fetch";
34// Base URL for the dist/json directory (using main branch)
40const url = `${JSON_BASE_URL}${catalog}.json`;
41console.log(`Downloading ${catalog} from ${url}`);
42const response = await fetch(url);
43if (!response.ok) {
44throw new Error(`Failed to download ${catalog}: ${response.status} - ${response.statusText}`);
ChatEnhancedCommandPalette.tsx4 matches
78const argumentInputRefs = useRef<Map<string, HTMLInputElement>>(new Map());
7980// Initialize MCP clients and fetch prompts/tools
81useEffect(() => {
82const initializeClients = async () => {
104}
105106// Fetch prompts and tools
107const [prompts, tools] = await Promise.all([
108client.listPrompts().catch(() => {
109console.warn(`Failed to fetch prompts for ${server.name}`);
110return [];
111}),
112client.listTools().catch(() => {
113console.warn(`Failed to fetch tools for ${server.name}`);
114return [];
115}),
45return new Promise((resolve, reject) => {
6fetch(`https://o.img.rodeo${url.pathname}`, { headers: req.headers })
7.then(response => response.body)
8.then(rs => resolve(new Response(rs)));
tuempresaValidationCatalogGrok.tsx5 matches
11};
1213async function fetchRecord(table: string, recordId: string) {
14const res = await fetch(`https://api.airtable.com/v0/${AIRTABLE_BASE_ID}/${table}/${recordId}`, {
15headers: airtableHeaders,
16});
17if (!res.ok) throw new Error(`Failed to fetch record ${recordId} from ${table}: ${res.status}`);
18return (await res.json()).fields;
19}
2829console.log(`Iniciando validación de catálogos SAT para Viaje ID: ${recordId}`);
30const viaje = await fetchRecord(VIAJES_TABLE, recordId);
31if (!viaje) throw new Error("Viaje no encontrado");
3234if (bienesIds.length === 0) throw new Error("Se requiere al menos un Bien");
3536const bienes = await Promise.all(bienesIds.map((id: string) => fetchRecord(BIENES_TABLE, id)));
3738console.log("Cargando catálogos SAT...");
tuempresaValidationCatalogGemini.tsx17 matches
1import { blob } from "https://esm.town/v/std/blob";
2import { fetch } from "https://esm.town/v/std/fetch";
3import { sqlite } from "https://esm.town/v/std/sqlite";
424}
2526const fetchLinkedRecord = async (tableId: string, recordId: string) => {
27const res = await fetch(`https://api.airtable.com/v0/${AIRTABLE_BASE_ID}/${tableId}/${recordId}`, {
28headers: airtableHeaders,
29});
31const errorText = await res.text();
32// El error de Airtable será capturado aquà con el mensaje especÃfico
33throw new Error(`Airtable fetch failed for ${tableId}/${recordId}: ${res.status} - ${errorText}`);
34}
35return (await res.json()).fields;
36};
3738const fetchMultipleLinkedRecords = async (tableId: string, recordIds: string[]) => {
39if (!recordIds || recordIds.length === 0) return [];
40const records = await Promise.all(recordIds.map(id => fetchLinkedRecord(tableId, id)));
41return records;
42};
4344const updateAirtableFields = async (targetTable: string, targetRecordId: string, fields: Record<string, any>) => {
45const res = await fetch(`https://api.airtable.com/v0/${AIRTABLE_BASE_ID}/${targetTable}/${targetRecordId}`, {
46method: "PATCH",
47headers: airtableHeaders,
66console.log("Base de datos de catálogos SAT cargada.");
6768const viajeData = await fetchLinkedRecord(VIAJES_TABLE, recordId);
6970const emisorId = viajeData.Emisor?.[0];
81const [emisor, clienteOrigen, clienteDestino, origen, destino, unidad, operador, remolque, bienes] = await Promise
82.all([
83emisorId ? fetchLinkedRecord(CLIENTES_TABLE, emisorId) : Promise.resolve(null),
84clienteOrigenId ? fetchLinkedRecord(CLIENTES_TABLE, clienteOrigenId) : Promise.resolve(null),
85clienteDestinoId ? fetchLinkedRecord(CLIENTES_TABLE, clienteDestinoId) : Promise.resolve(null),
86origenId ? fetchLinkedRecord(UBICACIONES_TABLE, origenId) : Promise.resolve(null),
87destinoId ? fetchLinkedRecord(UBICACIONES_TABLE, destinoId) : Promise.resolve(null),
88unidadId ? fetchLinkedRecord(UNIDADES_TABLE, unidadId) : Promise.resolve(null),
89operadorId ? fetchLinkedRecord(OPERADORES_TABLE, operadorId) : Promise.resolve(null),
90remolqueId ? fetchLinkedRecord(REMOLQUES_TABLE, remolqueId) : Promise.resolve(null),
91fetchMultipleLinkedRecords(BIENES_TABLE, bienesIds),
92]);
93