Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
feat: implement rider passes API with GET, POST, and DELETE methods
nirholas2fca2b2e4bae
diff --git a/api/admin/rider-passes.js b/api/admin/rider-passes.jsnew file mode 100644index 000000000..8b08e1bc8--- /dev/null+++ b/api/admin/rider-passes.js@@ -0,0 +1,43 @@+import { sql } from '../_lib/db.js';+import { cors, json, method, wrap, error, readJson } from '../_lib/http.js';+import { requireAdmin } from '../_lib/admin.js';++export default wrap(async (req, res) => {+ if (cors(req, res, { methods: 'GET,POST,DELETE,OPTIONS', credentials: true })) return;+ if (!(await requireAdmin(req, res))) return;++ if (req.method === 'GET') {+ const passes = await sql`+ select wallet_address, amount_paid, tx_signature, created_at+ from rider_passes+ order by created_at desc+ `;+ return json(res, 200, { passes });+ }++ if (req.method === 'POST') {+ const body = await readJson(req);+ const address = body?.wallet_address?.trim();+ if (!address) return error(res, 400, 'validation_error', 'wallet_address required');++ await sql`+ insert into rider_passes (wallet_address, amount_paid, tx_signature)+ values (${address}, ${body.amount_paid ?? 8000}, ${body.tx_signature ?? 'manual'})+ on conflict (wallet_address) do update+ set amount_paid = excluded.amount_paid,+ tx_signature = excluded.tx_signature+ `;+ return json(res, 200, { ok: true });+ }++ if (req.method === 'DELETE') {+ const body = await readJson(req);+ const address = body?.wallet_address?.trim();+ if (!address) return error(res, 400, 'validation_error', 'wallet_address required');++ await sql`delete from rider_passes where wallet_address = ${address}`;+ return json(res, 200, { ok: true });+ }++ if (!method(req, res, ['GET', 'POST', 'DELETE'])) return;+});