ssscQuizadmin.http.ts3 matches
128});
129} catch (error) {
130return c.json({ error: "Failed to fetch data" }, 500);
131}
132});
629
630try {
631const response = await fetch(\`/api/submissions/\${id}\`, {
632method: 'DELETE',
633headers: {
736}
737
738export default app.fetch;
ssscQuizindex.http.ts3 matches
318});
319} catch (error) {
320console.error("Error fetching analytics:", error);
321return c.json({ error: "Failed to fetch analytics" }, 500);
322}
323});
539
540// Export the Hono app as the default export for HTTP val
541export default app.fetch;
townie-testingexample-apis.ts2 matches
26}
27
28const response = await fetch(apiUrl);
29
30if (!response.ok) {
38
39} catch (error) {
40return new Response(`Fetch Error: ${error.message}`, { status: 500 });
41}
42}
70setIsSubmitting(true);
71try {
72const response = await fetch('/api/submit-quiz', {
73method: 'POST',
74headers: {
44});
4546export default app.fetch;
47
tuempresaallinone.tsx26 matches
1import { blob } from "https://esm.town/v/std/blob";
2import { fetch } from "https://esm.town/v/std/fetch";
34export default async function generateCartaPorteCFDI(req: Request): Promise<Response> {
47};
4849const fetchRecord = async (tableId: string, id: string) => {
50const res = await fetch(`https://api.airtable.com/v0/${AIRTABLE_BASE_ID}/${tableId}/${id}`, {
51headers: airtableHeaders,
52});
53if (!res.ok) {
54const errorText = await res.text();
55throw new Error(`Airtable fetch failed for ${tableId}/${id}: ${res.status} - ${errorText}`);
56}
57return (await res.json()).fields;
58};
5960const fetchMultipleLinkedRecords = async (tableId: string, recordIds: string[]) => {
61if (!recordIds || recordIds.length === 0) return [];
62const records = await Promise.all(recordIds.map(id => fetchRecord(tableId, id)));
63return records;
64};
69form.append("upload_preset", CLOUDINARY_UPLOAD_PRESET);
7071const res = await fetch(`https://api.cloudinary.com/v1_1/${CLOUDINARY_CLOUD_NAME}/upload`, {
72method: "POST",
73body: form,
8384const updateAirtableFields = async (tableId: string, id: string, fields: Record<string, any>) => {
85const res = await fetch(`https://api.airtable.com/v0/${AIRTABLE_BASE_ID}/${tableId}/${id}`, {
86method: "PATCH",
87headers: airtableHeaders,
94};
9596const fetchFromFacturama = async (id: string, type: "xml" | "pdf") => {
97const url = `https://apisandbox.facturama.mx/api/Cfdi/${type}/issued/${id}`;
98const res = await fetch(url, {
99headers: {
100Authorization: FACTURAMA_AUTH,
104105const body = await res.text();
106if (!res.ok) throw new Error(`Facturama ${type.toUpperCase()} fetch failed: ${res.status} - ${body}`);
107return JSON.parse(body)?.Content;
108};
199console.log("Catálogos JSON cargados exitosamente.");
200201// Fetch all related Airtable records in parallel
202const viajeData = await fetchRecord(VIAJES_TABLE, recordId);
203204const emisorId = viajeData.Emisor?.[0];
223bienes,
224] = await Promise.all([
225emisorId ? fetchRecord(CLIENTES_TABLE, emisorId) : Promise.resolve(null),
226clienteOrigenId ? fetchRecord(CLIENTES_TABLE, clienteOrigenId) : Promise.resolve(null),
227clienteDestinoId ? fetchRecord(CLIENTES_TABLE, clienteDestinoId) : Promise.resolve(null),
228origenId ? fetchRecord(UBICACIONES_TABLE, origenId) : Promise.resolve(null),
229destinoId ? fetchRecord(UBICACIONES_TABLE, destinoId) : Promise.resolve(null),
230unidadId ? fetchRecord(UNIDADES_TABLE, unidadId) : Promise.resolve(null),
231operadorId ? fetchRecord(OPERADORES_TABLE, operadorId) : Promise.resolve(null),
232fetchMultipleLinkedRecords(REMOLQUES_TABLE, remolqueIds), // Siempre fetch como mĂşltiples
233fetchMultipleLinkedRecords(BIENES_TABLE, bienesIds),
234]);
235545let calculatedTotalDistRec = 0;
546if (viajeData.Ubicaciones && Array.isArray(viajeData.Ubicaciones)) {
547const ubicacionRecords = await fetchMultipleLinkedRecords(UBICACIONES_TABLE, viajeData.Ubicaciones);
548for (const ubData of ubicacionRecords) {
549if (
771console.log("Receiver Name enviado:", cfdi.Receiver.Name);
772773const facturamaRes = await fetch("https://apisandbox.facturama.mx/3/cfdis", {
774method: "POST",
775headers: {
813814const [xmlBase64, pdfBase64] = await Promise.all([
815fetchFromFacturama(id, "xml"),
816fetchFromFacturama(id, "pdf"),
817]);
818
506this.addEventListeners();
507try {
508const res = await fetch(window.location.pathname + '?action=getWorkflows');
509this.state.workflows = await res.json();
510this.renderSelector();
568this.elements.rejectBtn.disabled = true;
569try {
570const res = await fetch(window.location.pathname + \`?action=\${action}\`, {
571method: 'POST',
572headers: {'Content-Type': 'application/json'},
1import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook";
2import { fetchAndPostCommits } from "./process-commits.tsx";
34/**
11if (lastRunAt instanceof Date && lastRunAt.getTime() <= now.getTime()) {
12const sinceTimestamp = lastRunAt.toISOString();
13await fetchAndPostCommits(sinceTimestamp, untilTimestamp);
14} else {
15console.log("Skipped commit fetching: No valid or previous lastRunAt.");
16}
17}
Change-Logs-GeneratorREADME.md2 matches
1# GitHub to Discord Changelog Notifier
23A val that automatically fetches GitHub commits from **multiple repositories** and posts formatted changelog updates to Discord. It categorizes commits based on [conventional commit messages](https://www.conventionalcommits.org/en/v1.0.0/) ie. `feat:`, `fix:` etc., and uses AI to generate user-friendly summaries.
45**Example:**
37### How to use
3839- **`gh-to-discord.tsx`** is a cron that runs automatically based on your configured schedule, fetching commits since the last run
4041- **`playground.tsx`**
Change-Logs-Generatorprocess-commits.tsx12 matches
296297/**
298* Fetch commits from GitHub for the given date range
299*/
300export async function fetchCommits(
301since: string,
302until: string,
310const octokit = new Octokit({ auth: GITHUB_TOKEN });
311312// Fetch commits from all repositories
313console.log(
314`Fetching commits from ${REPOS.length} repositories between ${since} and ${until}`,
315);
316318319try {
320// Fetch commits from each repository
321for (const repo of REPOS) {
322console.log(
323`Fetching commits from ${repo.owner}/${repo.name} (${repo.branch})`,
324);
325346} catch (repoError) {
347console.error(
348`❌ Error fetching commits from ${repo.owner}/${repo.name} (${repo.branch}):`,
349repoError.message,
350);
385386/**
387* Fetch commits and post to Discord
388*/
389export async function fetchAndPostCommits(
390since: string,
391until: string,
395}
396397// Fetch commits from GitHub
398const commits = await fetchCommits(since, until);
399400// If no commits are found, return early
405return;
406}
407console.log(`Fetched ${commits.length} new commits.`);
408409// Process commits with LLM summary