3132// ------------
33// Functions
34// ------------
3536async function execute(statement: InStatement): Promise<ResultSet> {
37const res = await fetch(`${API_URL}/v1/sqlite/execute`, {
38method: "POST",
48}
4950async function batch(statements: InStatement[], mode?: TransactionMode): Promise<ResultSet[]> {
51const res = await fetch(`${API_URL}/v1/sqlite/batch`, {
52method: "POST",
62}
6364function createResError(body: string) {
65try {
66const e = zLibsqlError.parse(JSON.parse(body));
113*
114* The types are currently shown for types declared in a SQL table. For
115* column types of function calls, for example, an empty string is
116* returned.
117*/
3const php = new PhpWeb();
45export default async function(req: Request): Promise<Response> {
6let output = "";
7let headers = new Headers();
5556// Simple router
57function route($uri, $method) {
58switch ($uri) {
59case '/api':
79<title>Greeting Form</title>
80<script>
81async function submitForm(event) {
82event.preventDefault();
83const form = event.target;
hnTopStorymain.tsx1 match
34// Get the title of the top story on Hacker News
5export async function hnTopStory() {
6const topStories: Number[] = await fetch(
7"https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty",
45/**
6* Provides functions for interacting with your account's blob storage.
7* Blobs can store any data type (text, JSON, images, etc.) and allow
8* retrieval across different vals using the same key.
80};
8182async function list(prefix?: string): Promise<{ key: string; size: number; lastModified: string }[]> {
83let querystring = prefix ? `?prefix=${encodeURIComponent(prefix)}` : "";
84const res = await fetch(`${API_URL}/v1/blob${querystring}`, {
94}
9596async function delete_(key: string) {
97const res = await fetch(`${API_URL}/v1/blob/${encodeURIComponent(key)}`, {
98method: "DELETE",
107}
108109async function get(key: string) {
110const res = await fetch(`${API_URL}/v1/blob/${encodeURIComponent(key)}`, {
111headers: {
123}
124125async function set(key: string, value: BodyInit) {
126const res = await fetch(`${API_URL}/v1/blob/${encodeURIComponent(key)}`, {
127method: "POST",
137}
138139async function copy(previous: string, next: string) {
140const res = await get(previous);
141await set(next, res.body);
142}
143144async function move(previous: string, next: string) {
145await copy(previous, next);
146await delete_(previous);
147}
148149async function getJSON<T = unknown>(key: string): Promise<T> {
150try {
151const res = await get(key);
159}
160161async function setJSON(key: string, value: any) {
162return set(key, JSON.stringify(value));
163}
3const QuickJS = await newQuickJSWASMModuleFromVariant(releaseVariant);
45async function main() {
6const vm = QuickJS.newContext();
7
lucia_adapter_basemain.tsx3 matches
127}
128129function transformIntoDatabaseSession(raw: SessionSchema): DatabaseSession {
130const { id, user_id: userId, expires_at: expiresAtUnix, ...attributes } = raw;
131return {
137}
138139function transformIntoDatabaseUser(raw: UserSchema): DatabaseUser {
140const { id, ...attributes } = raw;
141return {
145}
146147function escapeName(val: string): string {
148return "`" + val + "`";
149}
pgliteCountermain.tsx1 match
18})();
1920export default async function(req: Request): Promise<Response> {
21await init;
22await pg.query(`
11import { email } from "https://esm.town/v/std/email?v=13";
1213export default async function (interval: Interval) {
14const bookingInfo = await resyBot( {
15slug: 'amaro-bar',
18const ValTownOfficeDeviceId = "CD6F3A810848";
1920async function switchbotRequest(path, args) {
21const token = Deno.env.get("SWITCHBOT_TOKEN");
22const secret = Deno.env.get("SWITCHBOT_KEY");
42}
4344function botPress(device) {
45return switchbotRequest(`v1.1/devices/${device}/commands`, {
46method: "POST",