1export async function getPublicKey(handle) {
2 let { publicKey } = await import(`/v/${handle}/publicKey`);
3 return publicKey;
1export function runValAPI(name, ...args) {
2 return fetch(`https://api.val.town/v1/run/${name.replace("@", "")}`, {
3 method: "POST",
5type createClient = Awaited<ReturnType<typeof tursoImport>>["createClient"];
6
7export function turso(keys, handle?) {
8 let val = "@std.tursoAPI";
9 let f = (method) => (...args) =>
2import LZString from "npm:lz-string";
3
4export async function nodeJSDist(req: Request): Promise<Response> {
5 let url = new URL(req.url);
6 if (url.pathname === "/index.tab") {
5const url = "https://nodejs.org/dist/index.tab";
6
7export async function pollNodeJS(interval: Interval) {
8 let resp = await fetch(url);
9 if (!resp.ok) return;
2Gets information about a specific val.
3
4To access private vals, pass your API token as a secret to the function. Read more about [authentication](https://docs.val.town/api/authentication) to understand how to generate a token and save it as a secret.
5
6Migrated from folder: Archive/getVal
3export const parsePacoEx = (async () => {
4 var pako = await import("npm:pako");
5 function decodeMermaid(encodedString) {
6 var binaryData = Buffer.from(encodedString, "base64");
7 var inflatedString = pako.inflate(binaryData, { to: "string" });
1import { Buffer } from "node:buffer";
2
3export async function qr(req: express.Request, res: express.Response) {
4 if (req.path.startsWith("/qr")) {
5 const { qrcode } = await import("https://deno.land/x/qrcode/mod.ts");
20 let img = document.getElementsByTagName("img")[0]
21 let input = document.getElementsByTagName("input")[0]
22 input.addEventListener('input', function(e){
23 img.src="/qr?data=" + e.target.value
24 })
4 lon = +lon;
5 lat = +lat;
6 function dist(station) {
7 return Math.sqrt(
8 Math.pow(station.lat - lat, 2) + Math.pow(station.lon - lon, 2)
2
3export let getDuckDB = (async () => {
4 async function createWorker(url: string) {
5 const workerScript = await fetch(url);
6 const workerURL = URL.createObjectURL(await workerScript.blob());