/* Spiderman */
@layer base {
:root {
--background: 210 100% 20%;
--foreground: 0 100% 50%;
--card: 210 100% 25%;
--card-foreground: 0 100% 55%;
--popover: 210 100% 30%;
--popover-foreground: 0 100% 60%;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import crypto from "crypto"; | |
import { listAllSubscriptions } from "lemonsqueezy.ts"; | |
import { NextRequest } from "next/server"; | |
// Put this in your billing lib and just import the type instead | |
type LemonsqueezySubscription = Awaited<ReturnType<typeof listAllSubscriptions>>["data"][number]; | |
const isError = (error: unknown): error is Error => { | |
return error instanceof Error; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import crypto from 'crypto'; | |
import { NextResponse } from 'next/server'; | |
import { SLemonSqueezyWebhookRequest } from './models'; | |
import { db } from '@lib/db'; | |
import { subscriptions } from '@schema'; | |
import { eq } from 'drizzle-orm'; | |
import camelcaseKeys from 'camelcase-keys' | |
import { CamelCasedPropertiesDeep } from 'type-fest' // need CamelCasedPropertiesDeep because of https://github.com/sindresorhus/camelcase-keys/issues/77#issuecomment-1339844470 | |
import { ZodEffects, z } from 'zod'; | |
import PostHogClient from '@lib/posthog'; |