import { createContext } from "@idot-digital/function-generator"; import { Database } from "better-sqlite3"; import { z } from "zod"; import { ManagementClient } from "auth0"; export const secretsZod = z.object({ AUTH0_DOMAIN: z.string(), AUTH0_CLIENT_ID: z.string(), AUTH0_CLIENT_SECRET: z.string(), /** * The URL that the app is deployed to and accessible from. Used for auth0. */ DEPLOYMENT_URL: z.string(), /** * Comma separated list of URLs that are the base urls for the shortener. */ SHORTENER_URLS: z.string(), }); export type Secrets = z.infer; // Add your contexts here and call the "setContext" function in the "index.ts" file. // Functions created with the context can then access the context. export const ctx = createContext<{ sql: Database; secrets: Secrets; auth0: ManagementClient; }>();