buildclubProjectSearchmain.tsx3 matches
65const defaultEmbeddingColumn = "Embeddings";
6667async function fetchAirtableData(baseId, tableName, nameColumn, contentColumn, embeddingColumn) {
68const base = new Airtable({ apiKey: airtableApiKey }).base(baseId);
69const records = await base(tableName).select().all();
8687try {
88const documents = await fetchAirtableData(baseId, tableName, nameColumn, contentColumn, embeddingColumn);
89console.log('documents:', documents)
90await semanticSearch.addDocuments({documents, fields: 'embeddingsContent'});
132});
133134export default app.fetch;
135
airtablesemanticsearchmain.tsx4 matches
18const defaultEmbeddingColumn = "Embeddings";
1920async function fetchAirtableData(baseId, tableName, contentColumn, embeddingColumn) {
21const base = new Airtable({ apiKey: airtableApiKey }).base(baseId);
22const records = await base(tableName).select().all();
4142try {
43const documents = await fetchAirtableData(baseId, tableName, contentColumn, embeddingColumn);
44await semanticSearch.addDocuments(documents);
456364try {
65const documents = await fetchAirtableData(baseId, tableName, contentColumn, embeddingColumn);
66await semanticSearch.addDocuments(documents);
6774});
7576export default app.fetch;
imageDownSizermain.tsx2 matches
89function esmTown(url) {
10return fetch(url, {
11headers: {
12"User-Agent":
1718const app = new Hono();
19export default app.fetch;
2021app.get("/", async (c) =>
tealRattlesnakemain.tsx1 match
14});
1516export default app.fetch;
blob_adminmain.tsx2 matches
1/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
23import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import view_route from "https://esm.town/v/pomdtr/blob_admin_blob";
5import create_route from "https://esm.town/v/pomdtr/blob_admin_create";
153});
154155export default modifyFetchHandler(passwordAuth(app.fetch));
2526async function telegramRequest(path, body, authorization?: string) {
27const response = await fetch("https://stevekrouse-telegramValTownAPI.web.val.run/" + path, {
28method: "POST",
29body: JSON.stringify(body),
1export default function() {
2return fetch("file:///opt/render/project/src/guest/index.ts");
3}
openAQLocationmain.tsx2 matches
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2import { msDay } from "https://esm.town/v/stevekrouse/msDay";
36lon: number;
7}) => {
8const { results } = await fetchJSON(
9"https://api.openaq.org/v2/locations?"
10+ new URLSearchParams({
8import { API_URL } from "https://esm.town/v/std/API_URL";
910const response = await fetch(`${API_URL}/v1/me`, {
11headers: {
12Authorization: `Bearer ${Deno.env.get("valtown")}`,
HTreeTreePmain.tsx14 matches
32}`;
3334const DEFAULT_REQUEST = `let resp = await fetch("http://localhost");
35const logIt = () => {
36console.log(resp.status);
95work.onmessage = (e) => {
96try {
97const resp: { logs: Log[]; error?: { message: string; stack: string }; requests: FetchInfo[] } = JSON.parse(
98e.data,
99);
133);
134}
135async handleRequest(req: Request, requestId: string, fetchId: string): Promise<Response> {
136let requestRow = parseResultSet<RequestRow>(
137await sqlite.execute({
167await sqlite.execute({
168sql: `UPDATE requests SET handler_logs = json_insert(handler_logs, '$[#]',json(?)) WHERE id = ?`,
169args: [JSON.stringify({ id: parseInt(fetchId), logs }), requestId],
170});
171return resp;
258const requestId = req.headers.get("X-Request-ID");
259if (requestId) {
260const fetchId = req.headers.get("X-Fetch-ID");
261req.headers.delete("X-Request-ID");
262req.headers.delete("X-Fetch-ID");
263return app.handleRequest(req, requestId, fetchId);
264}
265if (req.method === "GET") {
309date: number;
310};
311type FetchInfo = {
312id: number;
313req: RequestObj;
319// outside of this function as it won't be available within the worker.
320const workerScript = () => {
321const requests: FetchInfo[] = [];
322323let proxyUrl: string;
324let requestId: number;
325let fetchCount: number = 1;
326let blobUrl: string;
327332.join("\n"));
333334globalThis.fetch = new Proxy(fetch, {
335async apply(target, thisArg, args) {
336const id = fetchCount++;
337const ogUrl = args[0];
338args[0] = proxyUrl;
340args[1].headers = args[1].headers || {};
341args[1].headers["X-Request-ID"] = requestId;
342args[1].headers["X-Fetch-ID"] = id;
343args[1].headers["X-Original-URL"] = ogUrl;
344const req: RequestObj = {
349};
350delete req.headers["X-Request-ID"];
351delete req.headers["X-Fetch-ID"];
352delete req.headers["X-Original-URL"];
353const stack = cleanStack((new Error()).stack).replaceAll(blobUrl, "./script.ts");