Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/andreijiroh-dev/api-servers. Monorepo for different Cloudflare Workers and Deno Deploy hosted APIs
Something went wrong. Try again.
1.7 kB · 62 lines
TypeScript
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263import { Bool, DateTime, Int, Str } from "chanfana";import { z } from "zod";
export const GoLinks = z.object({ id: Int({ required: false }), slug: Str({ required: true }), targetUrl: Str({ example: "https://example.com" }), is_active: z.boolean().default(true), deactivation_reason: Str({ required: false }), created_on: DateTime({ default: Date.now() }), updated_on: DateTime({ default: Date.now() }),});
export const DiscordInvites = z.object({ id: Int({ required: false }), slug: Str(), inviteCode: Str(), name: Str(), description: Str(), nsfw: z.boolean().default(false), is_active: z.boolean().default(true), deactivation_reason: Str({ required: false }), created_on: DateTime({ default: Date.now() }), updated_on: DateTime({ default: Date.now() }),});
/** * Just export WikiLinks as same schema as golinks */export const WikiLinks = GoLinks;
export interface EnvBindings { DEPLOY_ENV: "production" | "staging" | "development"; GIT_DEPLOY_COMMIT: string; SLACK_OAUTH_ID: string; SLACK_OAUTH_SECRET: string; SLACK_OAUTH_CALLBACK_URL: string; SLACK_SIGNING_SECRET: string; GITHUB_OAUTH_ID: string; GITHUB_OAUTH_SECRET: string; golinks: D1Database; ADMIN_KEY: string; BASE_URL: string; JWT_SIGNING_KEY: string; SLACK_OAUTH_STATE_SECRET: string; slackBotTokens: KVNamespace;}
/*type EnvBindings = { golinks: D1Database; BASE_URL: string; DEPLOY_ENV: "production" | "staging" | "development"; ADMIN_KEY: string; GIT_DEPLOY_COMMIT: string; SLACK_OAUTH_ID: string; SLACK_OAUTH_SECRET: string; SLACK_OAUTH_CALLBACK_URL: string; SLACK_SIGNING_SECRET: string; GITHUB_OAUTH_ID: string; GITHUB_OAUTH_SECRET: string; JWT_SIGNING_KEY: string};*/