bookReservationOnResymain.tsx7 matches
1import { fetch } from "https://esm.town/v/std/fetch";
23export const bookReservationOnResy = async ({
145)
146}&password=${encodeURIComponent(params.password)}`;
147const response = await fetch(`${RESY_API_URL}/3/auth/password`, {
148method: "POST",
149body: body,
167}) => {
168const url = `${RESY_API_URL}/3/details`;
169const response = await fetch(url.toString(), {
170method: "POST",
171headers: RESY_DEFAULT_HEADERS,
192searchParams.set("party_size", params.seats.toString());
193searchParams.set("venue_id", params.venueId);
194const response = await fetch(`${url}?${searchParams}`, {
195method: "GET",
196headers: RESY_DEFAULT_HEADERS,
212searchParams.set("url_slug", params.slug);
213searchParams.set("location", params.city);
214const response = await fetch(`${url}?${searchParams}`, {
215method: "GET",
216headers: RESY_DEFAULT_HEADERS,
224authToken: string;
225}) => {
226const response = await fetch(`${RESY_API_URL}/3/book`, {
227method: "POST",
228headers: {
252venueId,
253});
254console.log("Fetched available slots for day", {
255count: slots.length,
256times: slots.map((slot) => `${slot.date.start} -> ${slot.date.end}`),
umbrellaRemindermain.tsx2 matches
1import { email } from "https://esm.town/v/std/email?v=9";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3import { nominatimSearch } from "https://esm.town/v/stevekrouse/nominatimSearch";
4import { weatherGovGrid } from "https://esm.town/v/stevekrouse/weatherGovGrid";
14lon,
15});
16let { properties: { periods } } = await fetchJSON(
17grid.forecastHourly,
18);
multiplayerCirclesmain.tsx2 matches
86const y = d3.select(this).attr("cy");
8788fetch(`/update?x=${x}&y=${y}&i=${d3.select(this).attr("idx")}`, { method: "post" });
89d3.select(this).attr("stroke", null);
90}
190return new Response(body, { headers: { "Content-Type": "text/event-stream" } });
191});
192export default app.fetch;
82async 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}`, {
85headers: {
86Authorization: `Bearer ${Deno.env.get("valtown")}`,
9596async function delete_(key: string) {
97const res = await fetch(`${API_URL}/v1/blob/${encodeURIComponent(key)}`, {
98method: "DELETE",
99headers: {
108109async function get(key: string) {
110const res = await fetch(`${API_URL}/v1/blob/${encodeURIComponent(key)}`, {
111headers: {
112Authorization: `Bearer ${Deno.env.get("valtown")}`,
124125async function set(key: string, value: BodyInit) {
126const res = await fetch(`${API_URL}/v1/blob/${encodeURIComponent(key)}`, {
127method: "POST",
128headers: {
blobbyFacemain.tsx15 matches
2import { blobby } from "https://esm.town/v/yawnxyz/blobby";
3import { fileTypeFromBuffer } from 'npm:file-type';
4import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
5import { passwordAuth } from "https://esm.town/v/pomdtr/password_auth?v=74";
6666768// Endpoint to fetch blob by key
69app.get("/blob/:key", async (c) => {
70const key = c.req.param('key');
193this.blobs[key] = {isLoading: true};
194
195const response = await fetch('/blob/' + key);
196const contentType = response.headers.get('Content-Type');
197blob.type = contentType || 'text/plain';
223let blob = this.blobs[key];
224try {
225const response = await fetch('/create/' + key, {
226method: 'POST',
227headers: {
247248// Send a delete request to the server
249const response = await fetch('/delete/' + key, { method: 'GET' });
250251// Check the response status
313
314try {
315const response = await fetch('/upload/' + key, {
316method: 'POST',
317body: formData,
338
339try {
340const response = await fetch('/uploadUrl' + '?key=' + key + '&url=' + url);
341
342if (!response.ok) {
361if (!this.newKeyName) return;
362try {
363const response = await fetch('/rename?key='+key+'&newKey='+this.newKeyName);
364if (!response.ok) {
365throw new Error('Failed to rename blob');
526async loadBlob() {
527this.isLoading = true;
528const response = await fetch('/blob/' + this.key);
529const contentType = response.headers.get('Content-Type');
530this.blobType = contentType || 'text/plain';
550async updateCreate() {
551try {
552const response = await fetch('/create/' + this.key, {
553method: 'POST',
554headers: {
573574try {
575const response = await fetch('/upload/' + this.key, {
576method: 'POST',
577body: formData,
593if (this.uploadUrl) {
594try {
595const response = await fetch('/uploadUrl?key=' + this.key + '&url=' + this.uploadUrl);
596597if (!response.ok) {
610if (!this.newKeyName) return;
611try {
612const response = await fetch('/rename?key=' + this.key + '&newKey=' + this.newKeyName);
613if (!response.ok) {
614throw new Error('Failed to rename blob');
707708709// export default app.fetch;
710export default passwordAuth(app.fetch, {
711// password: "123", // Deno.env.get("AUTH_TEST"),
712});
sqliteExplorerAppmain.tsx4 matches
1/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
23import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
16import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
17import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
18import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
19import { Hono } from "npm:hono";
20import type { FC } from "npm:hono/jsx";
175});
176177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));
staticChessmain.tsx2 matches
1112constructor() {}
13async fetch(req: Request): Promise<Response> {
14if (new URL(req.url).pathname === "/robots.txt") {
15return new Response("User-agent: *\nDisallow: /");
232const sc = new StaticChess();
233234export default analyticsHandlerWrapper(sc.fetch.bind(sc));
blobbyFacemain.tsx15 matches
1import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
2import { passwordAuth } from "https://esm.town/v/pomdtr/password_auth?v=74";
3import { blobby } from "https://esm.town/v/yawnxyz/blobby";
57}
5859// Endpoint to fetch blob by key
60app.get("/blob/:key", async (c) => {
61const key = c.req.param("key");
181this.blobs[key] = {isLoading: true};
182
183const response = await fetch('/blob/' + key);
184const contentType = response.headers.get('Content-Type');
185blob.type = contentType || 'text/plain';
211let blob = this.blobs[key];
212try {
213const response = await fetch('/create/' + key, {
214method: 'POST',
215headers: {
235236// Send a delete request to the server
237const response = await fetch('/delete/' + key, { method: 'GET' });
238239// Check the response status
301
302try {
303const response = await fetch('/upload/' + key, {
304method: 'POST',
305body: formData,
326
327try {
328const response = await fetch('/uploadUrl' + '?key=' + key + '&url=' + url);
329
330if (!response.ok) {
349if (!this.newKeyName) return;
350try {
351const response = await fetch('/rename?key='+key+'&newKey='+this.newKeyName);
352if (!response.ok) {
353throw new Error('Failed to rename blob');
512async loadBlob() {
513this.isLoading = true;
514const response = await fetch('/blob/' + this.key);
515const contentType = response.headers.get('Content-Type');
516this.blobType = contentType || 'text/plain';
536async updateCreate() {
537try {
538const response = await fetch('/create/' + this.key, {
539method: 'POST',
540headers: {
559560try {
561const response = await fetch('/upload/' + this.key, {
562method: 'POST',
563body: formData,
579if (this.uploadUrl) {
580try {
581const response = await fetch('/uploadUrl?key=' + this.key + '&url=' + this.uploadUrl);
582583if (!response.ok) {
596if (!this.newKeyName) return;
597try {
598const response = await fetch('/rename?key=' + this.key + '&newKey=' + this.newKeyName);
599if (!response.ok) {
600throw new Error('Failed to rename blob');
685});
686687// export default app.fetch;
688export default passwordAuth(app.fetch, {
689// password: "123", // Deno.env.get("AUTH_TEST"),
690});
seiveDubbingmain.tsx2 matches
107},
108};
109const req = await fetch("https://mango.sievedata.com/v2/push", {
110method: "POST",
111body: JSON.stringify(payload),
120121async function pollDubbingJob(jobId) {
122const req = await fetch(`https://mango.sievedata.com/v2/jobs/${jobId}`, {
123headers: {
124"X-API-Key": SIEVE_API_KEY,
6const hnStoryURL = "https://hacker-news.firebaseio.com/v0/item/";
78const topStories = await fetch(hnTopStoriesURL).then((res) => res.json());
9const firstFive = topStories.slice(0, 50);
10const stories = await Promise.all(
11firstFive.map((id: number) => fetch(`${hnStoryURL}${id}.json`).then((res) => res.json())),
12);
13