untitled-2604new-file-9513.tsx12 matches
3// Fecha: 05 de mayo de 2025
45export default async function handler(req) {
6// ConfiguraciĂłn CORS para permitir solicitudes desde cualquier origen
7const headers = {
112113// FunciĂłn para llamar a la API de OpenAI
114async function callOpenAI(apiKey, prompt, model, temperature, maxTokens) {
115const url = 'https://api.openai.com/v1/chat/completions';
116
171172// FunciĂłn para llamar a la API de Claude (Anthropic)
173async function callClaude(apiKey, prompt, model, temperature, maxTokens) {
174const url = 'https://api.anthropic.com/v1/messages';
175
237238// FunciĂłn para renderizar la interfaz de usuario
239function renderUI() {
240return `
241<!DOCTYPE html>
398const tempSlider = document.getElementById('temperature');
399const tempValue = document.getElementById('temperatureValue');
400tempSlider.addEventListener('input', function() {
401tempValue.textContent = tempSlider.value;
402});
404// Cambiar entre pestañas
405const tabs = document.querySelectorAll('.tab');
406tabs.forEach(function(tab) {
407tab.addEventListener('click', function() {
408const tabName = tab.getAttribute('data-tab');
409
410// Desactivar todas las pestañas
411document.querySelectorAll('.tab').forEach(function(t) {
412t.classList.remove('active');
413});
414document.querySelectorAll('.tab-content').forEach(function(c) {
415c.classList.remove('active');
416});
433const modelSelect = document.getElementById('model');
434
435providerSelect.addEventListener('change', function() {
436const provider = providerSelect.value;
437
451});
452
453function addOption(select, value, text) {
454const option = document.createElement('option');
455option.value = value;
463const rawResult = document.getElementById('rawResult');
464
465submitBtn.addEventListener('click', async function() {
466const provider = document.getElementById('provider').value;
467const apiKey = document.getElementById('apiKey').value;
testPondiversedeleteCreation1 match
4import { TABLE_NAME } from "./updateTable";
56export default async function(req: Request): Promise<Response> {
7// body contains:
8// - id (number)
morningmailmain.tsx4 matches
2import { email } from "https://esm.town/v/std/email";
34function links(): string {
5var links = "- [Gisnep](https://gisnep.com)\n";
6links = links + "- [Gin](https://cardgames.io/ginrummy)\n";
10}
1112async function weather(): string {
13var weather = await blob.getJSON(Deno.env.get("WEATHER_BLOB"));
14weather = weather.forecast;
17}
1819async function wikitext(): string {
20const randomArticle = await fetch(
21"https://en.wikipedia.org/w/api.php?action=query&format=json&prop=extracts&exintro&explaintext&redirects=1&generator=random&formatversion=2&grnnamespace=0&grnlimit=3",
31}
3233export default async function(interval: Interval) {
34var emailText = "";
35emailText = emailText + await weather();
testPondiversemain1 match
6import updateTable from "./updateTable";
78export default async function(req: Request): Promise<Response> {
9let url = new URL(req.url);
10const path = url.pathname.toLowerCase();
3import { TABLE_NAME } from "./updateTable";
45export default async function(req: Request): Promise<Response> {
6const url = new URL(req.url);
7const id = url.searchParams.get("id");
18const lruCache = new LRUCache(ttlOptions);
1920export default async function(req: Request): Promise<Response> {
21const searchParams = new URL(req.url).searchParams;
22const discussionId = searchParams.get("discussion");
79}
8081async function getDiscussionPosts(discussionId: string): Promise<PostT[]> {
82// Used to get the list of post id's for the discussion.
83const discussionRes = await fetch(`${server}/api/discussions/${discussionId}`);
117118// This takes an array and chunks it.
119function chunkArray<T>(array: T[], chunkSize: number): T[][] {
120const chunks: T[][] = [];
121for (let i = 0; i < array.length; i += chunkSize) {
testOpenAIblah.tx1 match
1export default async function (req: Request): Promise<Response> {
2return Response.json({ ok: true })
3}
slack-prgithub-pr-inherit-labels.ts4 matches
4849// Main handler for HTTP requests
50export default async function(req: Request): Promise<Response> {
51console.log("🔍 Request received:", req.method, "URL:", req.url);
52console.log("🔍 Headers:", JSON.stringify(Object.fromEntries([...req.headers])));
166167// Extract issue numbers from PR body
168function extractIssueNumbers(body: string): number[] {
169// Match common issue linking keywords
170const patterns = [
191192// Fetch issue details
193async function fetchIssue(repo: string, issueNumber: number): Promise<GitHubIssue> {
194const token = Deno.env.get("GITHUB_TOKEN");
195
228229// Add labels to PR
230async function addLabelsToPR(repo: string, prNumber: number, labels: string[]) {
231const token = Deno.env.get("GITHUB_TOKEN");
232
slack-prgithub-pr-auto-assign.ts2 matches
3536// Main handler for HTTP requests
37export default async function(req: Request): Promise<Response> {
38console.log("🔍 Request received:", req.method, "URL:", req.url);
39console.log("🔍 Headers:", JSON.stringify(Object.fromEntries([...req.headers])));
141142// Assign a user to a PR
143async function assignUserToPR(repo: string, prNumber: number, username: string) {
144const token = Deno.env.get("GITHUB_TOKEN");
145
slack-prgithub-pr-title-prefix.ts3 matches
3132// Main handler for HTTP requests
33export default async function(req: Request): Promise<Response> {
34console.log("🔍 Request received:", req.method, "URL:", req.url);
35console.log("🔍 Headers:", JSON.stringify(Object.fromEntries([...req.headers])));
128129// Extract issue numbers from PR body
130function extractIssueNumbers(body: string): number[] {
131// Match common issue linking keywords
132const patterns = [
153154// Update PR title
155async function updatePRTitle(repo: string, prNumber: number, newTitle: string) {
156const token = Deno.env.get("GITHUB_TOKEN");
157