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
I contributed to the Semaphore Trusted Setup Multi-Party Ceremony. | |
The following are my contribution signatures: | |
Circuit: semaphore17 | |
Contributor # 293 | |
Hash: undefined | |
Circuit: semaphore16 | |
Contributor # 297 | |
Hash: 553aec2e 09336e08 75a1639b c81d87b7 | |
151430b2 d1e6f37c e08a0abc 17208418 |
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
"use server" | |
import { revalidatePath } from "next/cache"; | |
import { SLemonSqueezyRequest, TLemonSqueezyRequest } from "./zod-lemon-squeezy"; | |
const lemonSqueezyBaseUrl = 'https://api.lemonsqueezy.com/v1'; | |
const lemonSqueezyApiKey = process.env.LEMON_SQUEEZY_API_KEY; | |
if (!lemonSqueezyApiKey) throw new Error("No LEMON_SQUEEZY_API_KEY environment variable set"); |
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 { z } from 'zod'; | |
const SPagination = z.object({ | |
currentPage: z.number(), | |
from: z.number(), | |
lastPage: z.number(), | |
perPage: z.number(), | |
to: z.number(), | |
total: z.number(), | |
}); |
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 { currentUser } from '@clerk/nextjs' | |
import { User } from '@clerk/nextjs/dist/types/server' | |
import { CheckIcon } from '@heroicons/react/20/solid' | |
import { getProductVariants } from '@lib/lemon-squeezy' | |
import { cn } from '@lib/utils' | |
import { JSDOM } from 'jsdom' | |
import { CheckoutButton } from './checkout-button' | |
import { Badge } from './ui/badge' | |
export default async function Pricing({ |
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 { z } from 'zod'; | |
import camelcaseKeys from 'camelcase-keys' | |
const camelize = <T extends readonly unknown[] | Record<string, unknown>>( | |
val: T, | |
) => camelcaseKeys(val) | |
const Urls = z.object({ | |
update_payment_method: z.string(), | |
}).transform(camelize); |
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
// declaring enum in database for subscription status | |
export const subscriptionStatusEnum = pgEnum('subscription_status', [ | |
'on_trial', | |
'active', | |
'paused', | |
'past_due', | |
'unpaid', | |
'cancelled', | |
'expired', | |
]); |
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'; |
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 { NextResponse } from 'next/server'; | |
import { z } from 'zod'; | |
import camelcaseKeys from 'camelcase-keys' | |
import { db } from '@lib/db'; | |
import { products } from '@schema'; | |
export const runtime = 'edge' // 'nodejs' is the default | |
const camelize = <T extends readonly unknown[] | Record<string, unknown>>( |
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
"use server" | |
import { revalidatePath } from "next/cache"; | |
import { SLemonSqueezyRequest, TLemonSqueezyRequest } from "./zod-lemon-squeezy"; | |
const lemonSqueezyBaseUrl = 'https://api.lemonsqueezy.com/v1'; | |
const lemonSqueezyApiKey = process.env.LEMON_SQUEEZY_API_KEY; | |
if (!lemonSqueezyApiKey) throw new Error("No LEMON_SQUEEZY_API_KEY environment variable set"); |
OlderNewer