9}>;
10
11export function bindAction(actionUrl: string) {
12 bindActionToTrigger(actionUrl, import.meta.url)
13}
20);
21
22export default async function trigger(req: Request): Promise<Response> {
23 const url = new URL(req.url);
24
2import { valUrlToId } from "https://esm.town/v/wolf/valUrlToId?v=73";
3
4function getBlobKey(triggerUrl: string) {
5 const blobPrefix = "demo-webhook-trigger";
6 return `${blobPrefix}:${triggerUrl}`;
7}
8
9export async function bindActionToTrigger(actionUrl: string, triggerUrl: string) {
10 const triggerId = await valUrlToId(triggerUrl);
11 const blobKey = getBlobKey(triggerUrl);
16}
17
18export async function unbindActionFromTrigger(actionUrl: string, triggerUrl: string) {
19 const triggerId = await valUrlToId(triggerUrl);
20 const blobKey = getBlobKey(triggerUrl);
25}
26
27export async function listActionsForTrigger(triggerUrl: string): Promise<string[]> {
28 const triggerId = await valUrlToId(triggerUrl);
29 const blobKey = getBlobKey(triggerUrl);
2const headers = { "User-Agent": "Mozilla/5.0" };
3
4export async function valUrlToId(valUrl: string | undefined) {
5 if (!valUrl) valUrl = import.meta.url;
6 const valTownPage = valUrl.replace("esm.town", "val.town");
5console.log(await valUrlToId(import.meta.url));
6
7export async function bindToHandler(handlerId: string) {
8 const thisValId = await valUrlToId(import.meta.url);
9 return;
2import { valUrlToId } from "https://esm.town/v/wolf/valUrlToId?v=39";
3
4export async function bindToHandler(handlerId: string) {
5 const thisValId = await valUrlToId(import.meta.url);
6 const actions = new Set<string>(await blob.getJSON(handlerId));
9);
10
11export async function trigger(req: Request): Promise<Response> {
12 const url = new URL(req.url);
13
9 .join(" OR ") + " " + excludes;
10
11function relevant(t: Tweet) {
12 if (keywords.some(k => t.full_text?.includes(k))) return true;
13 return t.entities.urls?.some(u => keywords.some(k => u.expanded_url?.includes(k)));
18const isProd = true;
19
20export async function twitterAlert({ lastRunAt }: Interval) {
21 // search
22 const since = isProd
17];
18
19function App() {
20 const [selectedService, setSelectedService] = useState(null);
21 const [selectedStylist, setSelectedStylist] = useState(null);
116}
117
118function client() {
119 createRoot(document.getElementById("root")).render(<App />);
120}
121if (typeof document !== "undefined") { client(); }
122
123export default async function server(request: Request): Promise<Response> {
124 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
125 const KEY = "admirableTomatoLimpet";
3import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
4
5function App() {
6 const [writings, setWritings] = useState([]);
7 const [title, setTitle] = useState("");
58
59 useEffect(() => {
60 async function fetchWritings() {
61 try {
62 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
203};
204
205function client() {
206 createRoot(document.getElementById("root")).render(<App />);
207}
208if (typeof document !== "undefined") { client(); }
209
210export default async function server(request: Request): Promise<Response> {
211 return new Response(
212 `
11});
12
13function getStripeCustomer(customerId: string) {
14 return stripe.customers.retrieve(customerId);
15}
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": "*",