1export default async function(req: Request) {
2 const url = new URL(req.url);
3 const api = url.searchParams.get('api') || 'jsonplaceholder';
4
5 try {
6 let apiUrl: string;
7
8 switch (api) {
9 case 'jsonplaceholder':
10 const randomUserId = Math.floor(Math.random() * 10) + 1; // Random int from 1 to 10
11 apiUrl = `https://jsonplaceholder.typicode.com/users/${randomUserId}`;
12 break;
13 case 'httpbin':
14 apiUrl = 'https://httpbin.org/json';
15 break;
16 case 'cat-facts':
17 apiUrl = 'https://catfact.ninja/fact';
18 break;
19 case 'dog-api':
20 apiUrl = 'https://dog.ceo/api/breeds/image/random';
21 break;
22 default:
23 return new Response('Available APIs: jsonplaceholder, httpbin, cat-facts, dog-api\nUsage: ?api=jsonplaceholder', {
24 headers: { 'Content-Type': 'text/plain' }
25 });
26 }
27
28 const response = await fetch(apiUrl);
29
30 if (!response.ok) {
70 setIsSubmitting(true);
71 try {
72 const response = await fetch('/api/submit-quiz', {
73 method: 'POST',
74 headers: {
3
4export default async function generateCartaPorteCFDI(req: Request): Promise<Response> {
5 const AIRTABLE_API_KEY = Deno.env.get("AIRTABLE_API_KEY")!;
6 const AIRTABLE_BASE_ID = Deno.env.get("AIRTABLE_BASE_ID")!;
7 const FACTURAMA_AUTH = Deno.env.get("FACTURAMA_AUTH")!;
43
44 const airtableHeaders = {
45 Authorization: `Bearer ${AIRTABLE_API_KEY}`,
46 "Content-Type": "application/json",
47 };
48
49 const fetchRecord = async (tableId: string, id: string) => {
50 const res = await fetch(`https://api.airtable.com/v0/${AIRTABLE_BASE_ID}/${tableId}/${id}`, {
51 headers: airtableHeaders,
52 });
69 form.append("upload_preset", CLOUDINARY_UPLOAD_PRESET);
70
71 const res = await fetch(`https://api.cloudinary.com/v1_1/${CLOUDINARY_CLOUD_NAME}/upload`, {
72 method: "POST",
73 body: form,
83
84 const updateAirtableFields = async (tableId: string, id: string, fields: Record<string, any>) => {
85 const res = await fetch(`https://api.airtable.com/v0/${AIRTABLE_BASE_ID}/${tableId}/${id}`, {
86 method: "PATCH",
87 headers: airtableHeaders,
95
96 const fetchFromFacturama = async (id: string, type: "xml" | "pdf") => {
97 const url = `https://apisandbox.facturama.mx/api/Cfdi/${type}/issued/${id}`;
98 const res = await fetch(url, {
99 headers: {
771 console.log("Receiver Name enviado:", cfdi.Receiver.Name);
772
773 const facturamaRes = await fetch("https://apisandbox.facturama.mx/3/cfdis", {
774 method: "POST",
775 headers: {
203 const { name, role } = acp.payload.content.crmData;
204 const templates = {
205 "Developer": "you'll find our API documentation and sandbox environment particularly useful",
206 "Data Scientist": "our data integration pipelines and visualization tools will help you get insights faster",
207 "Project Manager": "you can leverage our Gantt charts and reporting dashboards to keep your projects on track",
318 name: "Automated Incident Response",
319 description: "Diagnose and create a remediation plan for a system alert.",
320 initialPayloadSchema: `{ "service": "api-gateway", "severity": "critical", "summary": "High CPU usage." }`,
321 steps: [
322 triageAgent,
563 },
564
565 async apiCall(action, body) {
566 this.elements.startBtn.disabled = true;
567 this.elements.approveBtn.disabled = true;
573 body: JSON.stringify(body),
574 });
575 if (!res.ok) throw new Error(\`API Error: \${res.statusText}\`);
576 return await res.json();
577 } catch (e) {
591 this.state.currentPayload = payload;
592
593 const data = await this.apiCall('runWorkflow', { workflowId: this.state.currentWorkflowId, payload });
594 this.processApiResponse(data);
595 },
596
606 };
607
608 const data = await this.apiCall('runWorkflow', {
609 workflowId: this.state.currentWorkflowId,
610 payload: this.state.currentPayload,
612 stepIndex: this.state.nextStepIndex,
613 });
614 this.processApiResponse(data);
615 },
616
617 processApiResponse(data) {
618 if (!data) return;
619 if(data.log) data.log.forEach(entry => this.logStatus(entry.agent, entry.status, entry.message));
621 const result = data.finalResult;
622 if(!result) {
623 this.logStatus('system', 'error', 'API response was missing a final result.');
624 return;
625 }
15const REPOS = [
16 { owner: "steel-dev", name: "steel-browser", branch: "main" },
17 { owner: "steel-dev", name: "steel-api", branch: "develop" },
18 { owner: "steel-dev", name: "steel-docs", branch: "main" },
19];
73Enhanced logging system for better debugging
74Fixed occasional 500 error with the /sessions endpoint
75UI docker image now accepts dynamic API URLs for custom deploys
76Fixes to re-render bugs that were causing some state update delays
77Fixes requests ordering from FE to preload data for a snappier UI
379 return allCommits;
380 } catch (error) {
381 console.error("GitHub API Error:", error);
382 throw error;
383 }
2
3export default async function generateCartaPorteCFDI(req: Request): Promise<Response> {
4 const AIRTABLE_API_KEY = Deno.env.get("AIRTABLE_API_KEY")!;
5 const AIRTABLE_BASE_ID = Deno.env.get("AIRTABLE_BASE_ID")!;
6 const FACTURAMA_AUTH = Deno.env.get("FACTURAMA_AUTH")!;
20
21 const airtableHeaders = {
22 Authorization: `Bearer ${AIRTABLE_API_KEY}`,
23 "Content-Type": "application/json",
24 };
25
26 const fetchRecord = async (tableId: string, id: string) => {
27 const res = await fetch(`https://api.airtable.com/v0/${AIRTABLE_BASE_ID}/${tableId}/${id}`, {
28 headers: airtableHeaders,
29 });
46 form.append("upload_preset", CLOUDINARY_UPLOAD_PRESET);
47
48 const res = await fetch(`https://api.cloudinary.com/v1_1/${CLOUDINARY_CLOUD_NAME}/upload`, {
49 method: "POST",
50 body: form,
60
61 const updateAirtableFields = async (tableId: string, id: string, fields: Record<string, any>) => {
62 const res = await fetch(`https://api.airtable.com/v0/${AIRTABLE_BASE_ID}/${tableId}/${id}`, {
63 method: "PATCH",
64 headers: airtableHeaders,
72
73 const fetchFromFacturama = async (id: string, type: "xml" | "pdf") => {
74 const url = `https://apisandbox.facturama.mx/api/Cfdi/${type}/issued/${id}`;
75 const res = await fetch(url, {
76 headers: {
383 console.log("Receiver Name enviado:", cfdi.Receiver.Name);
384
385 const facturamaRes = await fetch("https://apisandbox.facturama.mx/3/cfdis", {
386 method: "POST",
387 headers: {
21 }));
22
23app.get("/api/counter/get", async c => c.json(await db.get("counter")));
24app.get("/api/counter/increment", async c => c.json(await db.set("counter", (await db.get("counter") || 0) + 1)));
25
26app.get("/frontend/**/*", c => serveFile(c.req.path, import.meta.url));
58 <div className="">✷ Farcaster mini app manifest + webhook + embed metadata</div>
59 <div className="">✷ Farcaster notifications (storing tokens, sending recurring notifications, ...)</div>
60 <div className="">✷ Neynar API integration for Farcaster data</div>
61 <div className="">✷ Hosted on Val Town (instant deployments on save)</div>
62 <div className="">
72
73function Database() {
74 const queryFn = () => fetch("/api/counter/get").then((r) => r.json());
75 const { data, refetch } = useQuery({ queryKey: ["counter"], queryFn });
76 return (
78 {/* <h2 className="font-semibold">Database Example</h2> */}
79 <div className="">Counter value: {data}</div>
80 <Button variant="outline" onClick={() => fetch("/api/counter/increment").then(refetch)}>
81 Increment
82 </Button>
4 const TEXT = " Встерча и Работа ";
5
6 const url = `https://api.telegram.org/bot${TOKEN}/sendMessage`;
7
8 fetch(url, {