1export default async function (req: Request): Promise<Response> {
2 return Response.json({ ok: true })
3}
1export default function server(request: Request): Response {
2 // Define the redirect targets
3 const SPECIAL_REDIRECT_TARGET = "https://apple.com/apple-events";
2
3export const TABLE_NAME = "pondiverse_creations_v4";
4export default async function(req: Request): Promise<Response> {
5 await sqlite.execute(
6 `CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
6import updateTable from "./updateTable";
7
8export default async function(req: Request): Promise<Response> {
9 let url = new URL(req.url);
10 const path = url.pathname.toLowerCase();
3import { TABLE_NAME } from "./updateTable";
4
5export default async function(req: Request): Promise<Response> {
6 // First, get the row IDs of all rows that are older than 25 hours old
7 const res = await sqlite.execute(`
3import { TABLE_NAME } from "./updateTable";
4
5export default async function(req: Request): Promise<Response> {
6 const url = new URL(req.url);
7 const id = url.searchParams.get("id");
3import { TABLE_NAME } from "./updateTable";
4
5export default async function(req: Request): Promise<Response> {
6 const url = new URL(req.url);
7 const id = url.searchParams.get("id");
4import { TABLE_NAME } from "./updateTable";
5
6export default async function(req: Request): Promise<Response> {
7 // body contains:
8 // - id (number)
4import { TABLE_NAME } from "./updateTable";
5
6export default async function(req: Request): Promise<Response> {
7 // body contains:
8 // - title (string)
13const webhookIdToDelete = "51a2064a0098b4feacadfd7db51f6a21"; // ← Change this
14
15async function listWebhooks(apiKey: string, propertyId: string): Promise<CloudbedsWebhook[]> {
16 const res = await fetch(`https://hotels.cloudbeds.com/api/v1.2/getWebhooks?propertyID=${propertyId}`, {
17 headers: { Authorization: `Bearer ${apiKey}` },
29}
30
31async function deleteWebhookById(apiKey: string, id: string, url: string, object: string, action: string) {
32 const body = new URLSearchParams({
33 subscriptionID: id,
52}
53
54export default async function() {
55 const user = await blob.getJSON(`cloudbeds_user_${userId}`);
56 const apiKey = user?.cloudbedsAccounts?.[propertyId]?.apiKey;
A helper function to build a file's email
Simple functional CSS library for Val Town
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",