elevenLabsWidgetmain.tsx1 match
1export default async function server(request: Request): Promise<Response> {
2const url = new URL(request.url);
3const agentParam = url.searchParams.get("agent");
1import { Evaluation } from "npm:@autoblocks/client/testing";
23export default async function httpHandler(request: Request): Promise<Response> {
4if (request.method !== "POST") {
5return Response.json({ message: "Invalid method." }, {
7});
89export default async function(interval: Interval) {
10const subdomain = "valtownfornotion";
11const items = await blob.list(subdomain);
GlancernotionHelpers.ts20 matches
7});
89export async function createDatabasePagesParallel(databaseId: string, pages: []) {
10const creations = pages.map((page) =>
11notion.pages.create({
4344// delete all database rows
45export async function deleteAllDatabasePagesParallel(databaseId: string) {
46const pageIds = await notion.databases.query({
47database_id: databaseId,
59}
6061export async function getDatabaseId(databaseTitle: string) {
62// getDatabaseId(databaseTitle)
63const database = await notion.databases
66}
6768export async function getDatabaseTitle(databaseId: string) {
69// getDatabaseTitle(databaseId)
70const database = await notion.databases.retrieve({ database_id: databaseId });
73}
7475export async function getDatabaseParentPageId(databaseId: string) {
76let currentBlockId = databaseId;
7798}
99100export async function getCalloutProperties(askingFor: string) {
101const blockProperties = (askingFor != "val.town")
102? {
121}
122123export async function findChildDatabaseBlocks(rootBlockId: string, blockIdentifier: string) {
124const matchingBlocks = [];
125126async function searchBlock(blockId) {
127const res = await notion.blocks.children.list({ block_id: blockId });
128165}
166167export async function findCalloutBlocks(rootBlockId: string, blockIdentifier: string) {
168const matchingBlocks = [];
169170async function searchBlock(blockId) {
171const res = await notion.blocks.children.list({ block_id: blockId });
172200}
201202export async function getBostonTime() {
203const now = new Date();
204213}
214215export async function listChildrenChildPages(blockId: string) {
216try {
217const response = await notion.blocks.children.list({
229}
230231export async function addFavicon(data?: any) {
232const pageId = data?.id;
233// use notion if nothing if the URL property is empty
234const url = await getWebhookPropertyValue(data, "Website") || "notion.com";
235// send the URL value to the function that will get the site's favicon location
236const faviconURL = await helpers.scrapeFaviconUrl(url);
237console.log({ "Verified favicon URL": faviconURL });
242}
243244export async function setPageStatus(object: any) {
245const { data, section, step } = object;
246const pageId = data?.id;
282}
283284export async function updatePageIcon(pageId: string, faviconURL?: string) {
285try {
286const response = await notion.pages.update({
302}
303304export async function listChildren(pageId: string) {
305// get page properties
306try {
318}
319320// Helper function to get property value from webhook payload
321export async function getWebhookPropertyValue(payload: any, propertyName: any) {
322let result = null;
323// check to see if the whole payload was sent, or just the data object
357}
358359export async function getNotionPage(pageId: string) {
360// get page properties
361try {
Glancerhelpers.ts5 matches
1export async function setBlobKey(object: any) {
2const { slug, clientPageId, containerId } = object;
3const blobKey = [ // key_legend: "[subdomain]--[id of guest page]--[id of container to be reset]",
11}
1213export async function slugify(str: string) {
14// const containerTitleSlug = (await helpers.setContainerTitle(c.req.headers.get("x-container-title"))).split(" ").join("-");
15return (str.replace(/[^\w\s]|_/g, "").replace(/\s+/g, " ").trim().toLowerCase()).split(" ").join("-");
16}
1718// Function to scrape favicon URL from a website
19export async function scrapeFaviconUrl(url: string) {
20try {
21// Ensure URL has protocol
75}
7677export async function extractCamelCaseWords(str: string) {
78if (!str) return [];
79
5859// if the blob exists that maps to this callout for this user, use the id property inside it
60// otherwise call the function to find the id of the callout for this user
61// const blockId = blobject // if therre's a blob, then this isn't the first call
62// ? blobject.id // use the id in the blob to speed up subsequent calls
filterValsmain.tsx1 match
1import { fetchPaginatedData } from "https://esm.town/v/nbbaier/fetchPaginatedData";
23export async function filterVals(id: string, filter: (value: any, index: number, array: any[]) => unknown) {
4const token = Deno.env.get("valtown");
5const res = await fetchPaginatedData(`https://api.val.town/v1/users/${id}/vals`, {
filterValsmain.tsx1 match
1import { fetchPaginatedData } from "https://esm.town/v/nbbaier/fetchPaginatedData";
2console.log('hi')
3export async function filterVals(id: string, filter: (value: any, index: number, array: any[]) => unknown) {
4const token = Deno.env.get("valtown");
5const res = await fetchPaginatedData(`https://api.val.town/v1/users/${id}/vals`, {
filterValsREADME.md1 match
1# filterVals
23This val exports a utility function that returns a list of all a user's val, filtered by a callback function.
45## Example
valreadmegeneratormain.tsx4 matches
4import React, { useRef, useState, useEffect } from "https://esm.sh/react@18.2.0";
56function App() {
7const [username, setUsername] = useState("");
8const [valName, setValName] = useState("");
158}
159160function client() {
161createRoot(document.getElementById("root")).render(<App />);
162}
163if (typeof document !== "undefined") { client(); }
164165export default async function server(request: Request): Promise<Response> {
166const url = new URL(request.url);
167const parts = url.pathname.split('/').filter(Boolean);
248});
249} catch (error) {
250console.error('Error in server function:', error);
251return new Response(`Error: ${error.message}`, { status: 500 });
252}