import { defineTable } from "convex/server";
import { v } from "convex/values";

export const rateLimitTables = {
  rate_limit_windows: defineTable({
    key: v.string(),
    limiterType: v.string(),
    count: v.number(),
    windowStart: v.number(),
    windowEnd: v.number(),
  })
    .index("by_key_type", ["key", "limiterType"])
    .index("by_windowEnd", ["windowEnd"]),
};
