Private
Public Access
1
0

Add 17 features: My Work view, card copy/numbering, calendar, bulk ops, custom fields, automations, webhooks, invites, import/export, and more

Features implemented across 6 batches:
- Batch A: Fix ColorPicker gradient sync, tenant custom logo, unarchive cards, board backgrounds
- Batch B: My Work view, card copy/duplicate, card numbering (BOARD-123)
- Batch C: Due date reminders (cron), card watching with notifications
- Batch D: Bulk card operations, column sorting, calendar view
- Batch E: Invite by link, board import/export (Pounce + Trello JSON)
- Batch F: Webhooks with HMAC signing, custom fields, automation rules engine

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Catherine Renelle
2026-02-27 08:50:15 -05:00
parent 3a11ed01e9
commit 8c41b33313
54 changed files with 3656 additions and 82 deletions
+51
View File
@@ -0,0 +1,51 @@
import { json, error } from '@sveltejs/kit';
import type { RequestHandler } from './$types.js';
import { withTenant } from '$lib/server/rls.js';
import { requireTenantAdmin } from '$lib/server/guards.js';
import crypto from 'crypto';
// List all invites for the current tenant
export const GET: RequestHandler = async ({ locals }) => {
const tenant = locals.tenant;
if (!tenant) throw error(400, 'Unknown tenant');
requireTenantAdmin(locals.user);
const invites = await withTenant(tenant.id, async (tx) => {
return tx.tenantInvite.findMany({
where: { tenantId: tenant.id },
orderBy: { expiresAt: 'desc' }
});
});
return json({ invites });
};
// Create a new invite
export const POST: RequestHandler = async ({ locals, request }) => {
const tenant = locals.tenant;
if (!tenant) throw error(400, 'Unknown tenant');
requireTenantAdmin(locals.user);
const body = await request.json().catch(() => ({}));
const role = body.role === 'ADMIN' ? 'ADMIN' : 'MEMBER';
const maxUses = typeof body.maxUses === 'number' && body.maxUses > 0 ? body.maxUses : null;
const expiresInDays = typeof body.expiresInDays === 'number' && body.expiresInDays > 0 ? body.expiresInDays : 7;
const code = crypto.randomBytes(9).toString('base64url');
const expiresAt = new Date(Date.now() + expiresInDays * 24 * 60 * 60 * 1000);
const invite = await withTenant(tenant.id, async (tx) => {
return tx.tenantInvite.create({
data: {
tenantId: tenant.id,
code,
role,
expiresAt,
createdBy: locals.user!.id,
maxUses
}
});
});
return json({ invite }, { status: 201 });
};