init: init prok

This commit is contained in:
2026-04-16 15:34:47 +08:00
commit db74381f13
56 changed files with 5850 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
{
"name": "@stamp/shared",
"version": "0.1.0",
"private": true,
"type": "module",
"main": "src/index.ts",
"scripts": {
"build": "tsc",
"db:generate": "prisma generate --schema=../../prisma/schema.prisma",
"db:migrate": "prisma migrate dev --schema=../../prisma/schema.prisma",
"db:push": "prisma db push --schema=../../prisma/schema.prisma"
},
"devDependencies": {
"typescript": "~5.9.3"
}
}

View File

@@ -0,0 +1,3 @@
import { PrismaClient } from "@prisma/client";
export const prisma = new PrismaClient();

View File

@@ -0,0 +1,2 @@
export { prisma } from "./db.js";
export type * from "./types.js";

View File

@@ -0,0 +1,30 @@
export type ApiResponse<T = unknown> = {
success: boolean;
data?: T;
error?: { code: string; message: string };
};
export type StampWithStatus = {
id: string;
name: string;
note: string | null;
imageColor: string;
imageGrey: string;
sortOrder: number;
collected: boolean;
collectedAt: string | null;
};
export type RedemptionRuleInfo = {
id: string;
name: string;
description: string | null;
threshold: number;
};
export type RedemptionRecord = {
id: string;
ruleName: string;
stampCount: number;
redeemedAt: string;
};

View File

@@ -0,0 +1,8 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "src"
},
"include": ["src"]
}