wip: zen lite

This commit is contained in:
Frank
2026-02-24 04:45:39 -05:00
parent cda2af2589
commit fb6d201ee0
41 changed files with 4127 additions and 432 deletions

View File

@@ -1,10 +1,10 @@
import { Database, eq, and, sql, inArray, isNull, count } from "../src/drizzle/index.js"
import { BillingTable, SubscriptionPlan } from "../src/schema/billing.sql.js"
import { BillingTable, BlackPlans } from "../src/schema/billing.sql.js"
import { UserTable } from "../src/schema/user.sql.js"
import { AuthTable } from "../src/schema/auth.sql.js"
const plan = process.argv[2] as (typeof SubscriptionPlan)[number]
if (!SubscriptionPlan.includes(plan)) {
const plan = process.argv[2] as (typeof BlackPlans)[number]
if (!BlackPlans.includes(plan)) {
console.error("Usage: bun foo.ts <count>")
process.exit(1)
}

View File

@@ -1,13 +1,7 @@
import { Database, and, eq, sql } from "../src/drizzle/index.js"
import { AuthTable } from "../src/schema/auth.sql.js"
import { UserTable } from "../src/schema/user.sql.js"
import {
BillingTable,
PaymentTable,
SubscriptionTable,
SubscriptionPlan,
UsageTable,
} from "../src/schema/billing.sql.js"
import { BillingTable, PaymentTable, SubscriptionTable, BlackPlans, UsageTable } from "../src/schema/billing.sql.js"
import { WorkspaceTable } from "../src/schema/workspace.sql.js"
import { BlackData } from "../src/black.js"
import { centsToMicroCents } from "../src/util/price.js"
@@ -235,7 +229,7 @@ function formatRetryTime(seconds: number) {
function getSubscriptionStatus(row: {
subscription: {
plan: (typeof SubscriptionPlan)[number]
plan: (typeof BlackPlans)[number]
} | null
timeSubscriptionCreated: Date | null
fixedUsage: number | null