basic working app currently wworking on the sync to work
Build APK / build (push) Canceled after 0s

This commit is contained in:
2026-08-06 11:16:47 +02:00
commit 793e2d9044
192 changed files with 42523 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
import { Request, Response, NextFunction } from 'express';
type AsyncHandler = (req: Request, res: Response, next: NextFunction) => Promise<unknown>;
export declare function asyncHandler(handler: AsyncHandler): (req: Request, res: Response, next: NextFunction) => void;
export {};
//# sourceMappingURL=asyncHandler.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"asyncHandler.d.ts","sourceRoot":"","sources":["../../src/utils/asyncHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE1D,KAAK,YAAY,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAE1F,wBAAgB,YAAY,CAAC,OAAO,EAAE,YAAY,IACxC,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,KAAG,IAAI,CAG/D"}
+9
View File
@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.asyncHandler = asyncHandler;
function asyncHandler(handler) {
return (req, res, next) => {
handler(req, res, next).catch(next);
};
}
//# sourceMappingURL=asyncHandler.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"asyncHandler.js","sourceRoot":"","sources":["../../src/utils/asyncHandler.ts"],"names":[],"mappings":";;AAIA,oCAIC;AAJD,SAAgB,YAAY,CAAC,OAAqB;IAChD,OAAO,CAAC,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAQ,EAAE;QAC/D,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC,CAAC;AACJ,CAAC"}
+9
View File
@@ -0,0 +1,9 @@
import { Request, Response, NextFunction } from 'express';
import { AuthPayload } from '../types';
export declare function generateToken(payload: AuthPayload): string;
export declare function verifyToken(token: string): AuthPayload | null;
export declare function authMiddleware(req: Request, res: Response, next: NextFunction): void;
export declare function optionalAuthMiddleware(req: Request, res: Response, next: NextFunction): void;
export declare function generateId(prefix?: string): string;
export declare function getCurrentTimestamp(): number;
//# sourceMappingURL=auth.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/utils/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAKvC,wBAAgB,aAAa,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAE1D;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAM7D;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CA4BpF;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAW5F;AAED,wBAAgB,UAAU,CAAC,MAAM,GAAE,MAAW,GAAG,MAAM,CAItD;AAED,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C"}
+70
View File
@@ -0,0 +1,70 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateToken = generateToken;
exports.verifyToken = verifyToken;
exports.authMiddleware = authMiddleware;
exports.optionalAuthMiddleware = optionalAuthMiddleware;
exports.generateId = generateId;
exports.getCurrentTimestamp = getCurrentTimestamp;
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
const JWT_SECRET = process.env.JWT_SECRET || 'your-super-secret-jwt-key-change-in-production';
const JWT_EXPIRES_IN = '7d';
function generateToken(payload) {
return jsonwebtoken_1.default.sign(payload, JWT_SECRET, { expiresIn: JWT_EXPIRES_IN });
}
function verifyToken(token) {
try {
return jsonwebtoken_1.default.verify(token, JWT_SECRET);
}
catch {
return null;
}
}
function authMiddleware(req, res, next) {
const authHeader = req.headers.authorization;
if (!authHeader || !authHeader.startsWith('Bearer ')) {
res.status(401).json({
error: {
code: 'UNAUTHORIZED',
message: 'Missing or invalid authorization header',
},
});
return;
}
const token = authHeader.slice(7);
const payload = verifyToken(token);
if (!payload) {
res.status(401).json({
error: {
code: 'UNAUTHORIZED',
message: 'Invalid or expired token',
},
});
return;
}
req.user = payload;
next();
}
function optionalAuthMiddleware(req, res, next) {
const authHeader = req.headers.authorization;
if (authHeader && authHeader.startsWith('Bearer ')) {
const token = authHeader.slice(7);
const payload = verifyToken(token);
if (payload) {
req.user = payload;
}
}
next();
}
function generateId(prefix = '') {
const timestamp = Date.now().toString(36);
const random = Math.random().toString(36).slice(2, 10);
return `${prefix}${prefix ? '_' : ''}${timestamp}${random}`;
}
function getCurrentTimestamp() {
return Date.now();
}
//# sourceMappingURL=auth.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/utils/auth.ts"],"names":[],"mappings":";;;;;AAOA,sCAEC;AAED,kCAMC;AAED,wCA4BC;AAED,wDAWC;AAED,gCAIC;AAED,kDAEC;AArED,gEAA+B;AAG/B,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,gDAAgD,CAAC;AAC9F,MAAM,cAAc,GAAG,IAAI,CAAC;AAE5B,SAAgB,aAAa,CAAC,OAAoB;IAChD,OAAO,sBAAG,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC,CAAC;AACtE,CAAC;AAED,SAAgB,WAAW,CAAC,KAAa;IACvC,IAAI,CAAC;QACH,OAAO,sBAAG,CAAC,MAAM,CAAC,KAAK,EAAE,UAAU,CAAgB,CAAC;IACtD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAgB,cAAc,CAAC,GAAY,EAAE,GAAa,EAAE,IAAkB;IAC5E,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC;IAE7C,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QACrD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;YACnB,KAAK,EAAE;gBACL,IAAI,EAAE,cAAc;gBACpB,OAAO,EAAE,yCAAyC;aACnD;SACF,CAAC,CAAC;QACH,OAAO;IACT,CAAC;IAED,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAClC,MAAM,OAAO,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IAEnC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;YACnB,KAAK,EAAE;gBACL,IAAI,EAAE,cAAc;gBACpB,OAAO,EAAE,0BAA0B;aACpC;SACF,CAAC,CAAC;QACH,OAAO;IACT,CAAC;IAED,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC;IACnB,IAAI,EAAE,CAAC;AACT,CAAC;AAED,SAAgB,sBAAsB,CAAC,GAAY,EAAE,GAAa,EAAE,IAAkB;IACpF,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC;IAE7C,IAAI,UAAU,IAAI,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QACnD,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAClC,MAAM,OAAO,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;QACnC,IAAI,OAAO,EAAE,CAAC;YACZ,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC;QACrB,CAAC;IACH,CAAC;IACD,IAAI,EAAE,CAAC;AACT,CAAC;AAED,SAAgB,UAAU,CAAC,SAAiB,EAAE;IAC5C,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACvD,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,CAAC;AAC9D,CAAC;AAED,SAAgB,mBAAmB;IACjC,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC;AACpB,CAAC"}
+649
View File
@@ -0,0 +1,649 @@
import { z } from 'zod';
export declare const categoryCreateSchema: z.ZodObject<{
name: z.ZodString;
color: z.ZodString;
order: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
name: string;
color: string;
order?: number | undefined;
}, {
name: string;
color: string;
order?: number | undefined;
}>;
export declare const categoryUpdateSchema: z.ZodObject<{
name: z.ZodOptional<z.ZodString>;
color: z.ZodOptional<z.ZodString>;
order: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
name?: string | undefined;
color?: string | undefined;
order?: number | undefined;
}, {
name?: string | undefined;
color?: string | undefined;
order?: number | undefined;
}>;
export declare const repeatSchema: z.ZodEnum<["none", "daily", "weekly", "monthly", "custom"]>;
export declare const taskCreateSchema: z.ZodObject<{
title: z.ZodString;
description: z.ZodOptional<z.ZodString>;
categoryId: z.ZodString;
priority: z.ZodOptional<z.ZodEnum<["none", "low", "medium", "high", "critical"]>>;
dueDate: z.ZodOptional<z.ZodNumber>;
dueTime: z.ZodNullable<z.ZodOptional<z.ZodString>>;
endTime: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
repeat: z.ZodOptional<z.ZodEnum<["none", "daily", "weekly", "monthly", "custom"]>>;
repeatInterval: z.ZodOptional<z.ZodNumber>;
repeatDays: z.ZodOptional<z.ZodString>;
seriesId: z.ZodOptional<z.ZodString>;
reminder: z.ZodOptional<z.ZodEnum<["none", "at_time", "15", "30", "60", "120", "1440"]>>;
assigneeId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
subtasks: z.ZodOptional<z.ZodArray<z.ZodObject<{
title: z.ZodString;
}, "strip", z.ZodTypeAny, {
title: string;
}, {
title: string;
}>, "many">>;
}, "strip", z.ZodTypeAny, {
categoryId: string;
title: string;
description?: string | undefined;
priority?: "none" | "low" | "medium" | "high" | "critical" | undefined;
dueDate?: number | undefined;
dueTime?: string | null | undefined;
endTime?: string | undefined;
repeat?: "custom" | "none" | "daily" | "weekly" | "monthly" | undefined;
repeatInterval?: number | undefined;
repeatDays?: string | undefined;
seriesId?: string | undefined;
assigneeId?: string | null | undefined;
reminder?: "none" | "at_time" | "15" | "30" | "60" | "120" | "1440" | undefined;
subtasks?: {
title: string;
}[] | undefined;
}, {
categoryId: string;
title: string;
description?: string | undefined;
priority?: "none" | "low" | "medium" | "high" | "critical" | undefined;
dueDate?: number | undefined;
dueTime?: string | null | undefined;
endTime?: string | undefined;
repeat?: "custom" | "none" | "daily" | "weekly" | "monthly" | undefined;
repeatInterval?: number | undefined;
repeatDays?: string | undefined;
seriesId?: string | undefined;
assigneeId?: string | null | undefined;
reminder?: "none" | "at_time" | "15" | "30" | "60" | "120" | "1440" | undefined;
subtasks?: {
title: string;
}[] | undefined;
}>;
export declare const taskUpdateSchema: z.ZodObject<{
title: z.ZodOptional<z.ZodString>;
description: z.ZodOptional<z.ZodString>;
categoryId: z.ZodOptional<z.ZodString>;
priority: z.ZodOptional<z.ZodEnum<["none", "low", "medium", "high", "critical"]>>;
completed: z.ZodOptional<z.ZodBoolean>;
dueDate: z.ZodOptional<z.ZodNumber>;
dueTime: z.ZodNullable<z.ZodOptional<z.ZodString>>;
endTime: z.ZodOptional<z.ZodString>;
assigneeId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
}, "strip", z.ZodTypeAny, {
categoryId?: string | undefined;
title?: string | undefined;
description?: string | undefined;
priority?: "none" | "low" | "medium" | "high" | "critical" | undefined;
completed?: boolean | undefined;
dueDate?: number | undefined;
dueTime?: string | null | undefined;
endTime?: string | undefined;
assigneeId?: string | null | undefined;
}, {
categoryId?: string | undefined;
title?: string | undefined;
description?: string | undefined;
priority?: "none" | "low" | "medium" | "high" | "critical" | undefined;
completed?: boolean | undefined;
dueDate?: number | undefined;
dueTime?: string | null | undefined;
endTime?: string | undefined;
assigneeId?: string | null | undefined;
}>;
export declare const subtaskCreateSchema: z.ZodObject<{
title: z.ZodString;
order: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
title: string;
order?: number | undefined;
}, {
title: string;
order?: number | undefined;
}>;
export declare const subtaskUpdateSchema: z.ZodObject<{
title: z.ZodOptional<z.ZodString>;
completed: z.ZodOptional<z.ZodBoolean>;
order: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
order?: number | undefined;
title?: string | undefined;
completed?: boolean | undefined;
}, {
order?: number | undefined;
title?: string | undefined;
completed?: boolean | undefined;
}>;
export declare const userSettingsSchema: z.ZodObject<{
darkMode: z.ZodOptional<z.ZodBoolean>;
notifications: z.ZodOptional<z.ZodBoolean>;
reminderTime: z.ZodOptional<z.ZodString>;
defaultCategory: z.ZodNullable<z.ZodOptional<z.ZodString>>;
sortBy: z.ZodOptional<z.ZodEnum<["dueDate", "priority", "title", "createdAt"]>>;
sortOrder: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
}, "strip", z.ZodTypeAny, {
darkMode?: boolean | undefined;
notifications?: boolean | undefined;
reminderTime?: string | undefined;
defaultCategory?: string | null | undefined;
sortBy?: "createdAt" | "title" | "priority" | "dueDate" | undefined;
sortOrder?: "asc" | "desc" | undefined;
}, {
darkMode?: boolean | undefined;
notifications?: boolean | undefined;
reminderTime?: string | undefined;
defaultCategory?: string | null | undefined;
sortBy?: "createdAt" | "title" | "priority" | "dueDate" | undefined;
sortOrder?: "asc" | "desc" | undefined;
}>;
export declare const repeatProfileSchema: z.ZodObject<{
name: z.ZodString;
repeat: z.ZodEnum<["none", "daily", "weekly", "monthly", "custom"]>;
repeatInterval: z.ZodNumber;
repeatDays: z.ZodString;
}, "strip", z.ZodTypeAny, {
name: string;
repeat: "custom" | "none" | "daily" | "weekly" | "monthly";
repeatInterval: number;
repeatDays: string;
}, {
name: string;
repeat: "custom" | "none" | "daily" | "weekly" | "monthly";
repeatInterval: number;
repeatDays: string;
}>;
export declare const friendRequestSchema: z.ZodObject<{
username: z.ZodString;
}, "strip", z.ZodTypeAny, {
username: string;
}, {
username: string;
}>;
export declare const friendshipSchema: z.ZodObject<{
id: z.ZodString;
userId: z.ZodString;
friendId: z.ZodString;
status: z.ZodEnum<["pending", "accepted"]>;
createdAt: z.ZodNumber;
updatedAt: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
id: string;
createdAt: number;
userId: string;
friendId: string;
status: "pending" | "accepted";
updatedAt: number;
}, {
id: string;
createdAt: number;
userId: string;
friendId: string;
status: "pending" | "accepted";
updatedAt: number;
}>;
export declare const pushChangesSchema: z.ZodObject<{
changes: z.ZodObject<{
categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
name: z.ZodString;
color: z.ZodString;
order: z.ZodOptional<z.ZodNumber>;
} & {
id: z.ZodString;
createdAt: z.ZodNumber;
updatedAt: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
id: string;
name: string;
createdAt: number;
updatedAt: number;
color: string;
order?: number | undefined;
}, {
id: string;
name: string;
createdAt: number;
updatedAt: number;
color: string;
order?: number | undefined;
}>, "many">>;
tasks: z.ZodOptional<z.ZodArray<z.ZodObject<{
title: z.ZodString;
description: z.ZodOptional<z.ZodString>;
categoryId: z.ZodString;
priority: z.ZodOptional<z.ZodEnum<["none", "low", "medium", "high", "critical"]>>;
dueDate: z.ZodOptional<z.ZodNumber>;
dueTime: z.ZodNullable<z.ZodOptional<z.ZodString>>;
endTime: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
repeat: z.ZodOptional<z.ZodEnum<["none", "daily", "weekly", "monthly", "custom"]>>;
repeatInterval: z.ZodOptional<z.ZodNumber>;
repeatDays: z.ZodOptional<z.ZodString>;
seriesId: z.ZodOptional<z.ZodString>;
reminder: z.ZodOptional<z.ZodEnum<["none", "at_time", "15", "30", "60", "120", "1440"]>>;
assigneeId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
subtasks: z.ZodOptional<z.ZodArray<z.ZodObject<{
title: z.ZodString;
}, "strip", z.ZodTypeAny, {
title: string;
}, {
title: string;
}>, "many">>;
} & {
id: z.ZodString;
completed: z.ZodBoolean;
createdAt: z.ZodNumber;
updatedAt: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
id: string;
createdAt: number;
updatedAt: number;
categoryId: string;
title: string;
completed: boolean;
description?: string | undefined;
priority?: "none" | "low" | "medium" | "high" | "critical" | undefined;
dueDate?: number | undefined;
dueTime?: string | null | undefined;
endTime?: string | undefined;
repeat?: "custom" | "none" | "daily" | "weekly" | "monthly" | undefined;
repeatInterval?: number | undefined;
repeatDays?: string | undefined;
seriesId?: string | undefined;
assigneeId?: string | null | undefined;
reminder?: "none" | "at_time" | "15" | "30" | "60" | "120" | "1440" | undefined;
subtasks?: {
title: string;
}[] | undefined;
}, {
id: string;
createdAt: number;
updatedAt: number;
categoryId: string;
title: string;
completed: boolean;
description?: string | undefined;
priority?: "none" | "low" | "medium" | "high" | "critical" | undefined;
dueDate?: number | undefined;
dueTime?: string | null | undefined;
endTime?: string | undefined;
repeat?: "custom" | "none" | "daily" | "weekly" | "monthly" | undefined;
repeatInterval?: number | undefined;
repeatDays?: string | undefined;
seriesId?: string | undefined;
assigneeId?: string | null | undefined;
reminder?: "none" | "at_time" | "15" | "30" | "60" | "120" | "1440" | undefined;
subtasks?: {
title: string;
}[] | undefined;
}>, "many">>;
subtasks: z.ZodOptional<z.ZodArray<z.ZodObject<{
title: z.ZodString;
order: z.ZodOptional<z.ZodNumber>;
} & {
id: z.ZodString;
taskId: z.ZodString;
completed: z.ZodBoolean;
createdAt: z.ZodNumber;
updatedAt: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
id: string;
createdAt: number;
updatedAt: number;
title: string;
completed: boolean;
taskId: string;
order?: number | undefined;
}, {
id: string;
createdAt: number;
updatedAt: number;
title: string;
completed: boolean;
taskId: string;
order?: number | undefined;
}>, "many">>;
repeatProfiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
name: z.ZodString;
repeat: z.ZodEnum<["none", "daily", "weekly", "monthly", "custom"]>;
repeatInterval: z.ZodNumber;
repeatDays: z.ZodString;
} & {
id: z.ZodString;
createdAt: z.ZodNumber;
updatedAt: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
id: string;
name: string;
createdAt: number;
updatedAt: number;
repeat: "custom" | "none" | "daily" | "weekly" | "monthly";
repeatInterval: number;
repeatDays: string;
}, {
id: string;
name: string;
createdAt: number;
updatedAt: number;
repeat: "custom" | "none" | "daily" | "weekly" | "monthly";
repeatInterval: number;
repeatDays: string;
}>, "many">>;
friendships: z.ZodOptional<z.ZodArray<z.ZodObject<{
id: z.ZodString;
userId: z.ZodString;
friendId: z.ZodString;
status: z.ZodEnum<["pending", "accepted"]>;
createdAt: z.ZodNumber;
updatedAt: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
id: string;
createdAt: number;
userId: string;
friendId: string;
status: "pending" | "accepted";
updatedAt: number;
}, {
id: string;
createdAt: number;
userId: string;
friendId: string;
status: "pending" | "accepted";
updatedAt: number;
}>, "many">>;
}, "strip", z.ZodTypeAny, {
friendships?: {
id: string;
createdAt: number;
userId: string;
friendId: string;
status: "pending" | "accepted";
updatedAt: number;
}[] | undefined;
categories?: {
id: string;
name: string;
createdAt: number;
updatedAt: number;
color: string;
order?: number | undefined;
}[] | undefined;
tasks?: {
id: string;
createdAt: number;
updatedAt: number;
categoryId: string;
title: string;
completed: boolean;
description?: string | undefined;
priority?: "none" | "low" | "medium" | "high" | "critical" | undefined;
dueDate?: number | undefined;
dueTime?: string | null | undefined;
endTime?: string | undefined;
repeat?: "custom" | "none" | "daily" | "weekly" | "monthly" | undefined;
repeatInterval?: number | undefined;
repeatDays?: string | undefined;
seriesId?: string | undefined;
assigneeId?: string | null | undefined;
reminder?: "none" | "at_time" | "15" | "30" | "60" | "120" | "1440" | undefined;
subtasks?: {
title: string;
}[] | undefined;
}[] | undefined;
subtasks?: {
id: string;
createdAt: number;
updatedAt: number;
title: string;
completed: boolean;
taskId: string;
order?: number | undefined;
}[] | undefined;
repeatProfiles?: {
id: string;
name: string;
createdAt: number;
updatedAt: number;
repeat: "custom" | "none" | "daily" | "weekly" | "monthly";
repeatInterval: number;
repeatDays: string;
}[] | undefined;
}, {
friendships?: {
id: string;
createdAt: number;
userId: string;
friendId: string;
status: "pending" | "accepted";
updatedAt: number;
}[] | undefined;
categories?: {
id: string;
name: string;
createdAt: number;
updatedAt: number;
color: string;
order?: number | undefined;
}[] | undefined;
tasks?: {
id: string;
createdAt: number;
updatedAt: number;
categoryId: string;
title: string;
completed: boolean;
description?: string | undefined;
priority?: "none" | "low" | "medium" | "high" | "critical" | undefined;
dueDate?: number | undefined;
dueTime?: string | null | undefined;
endTime?: string | undefined;
repeat?: "custom" | "none" | "daily" | "weekly" | "monthly" | undefined;
repeatInterval?: number | undefined;
repeatDays?: string | undefined;
seriesId?: string | undefined;
assigneeId?: string | null | undefined;
reminder?: "none" | "at_time" | "15" | "30" | "60" | "120" | "1440" | undefined;
subtasks?: {
title: string;
}[] | undefined;
}[] | undefined;
subtasks?: {
id: string;
createdAt: number;
updatedAt: number;
title: string;
completed: boolean;
taskId: string;
order?: number | undefined;
}[] | undefined;
repeatProfiles?: {
id: string;
name: string;
createdAt: number;
updatedAt: number;
repeat: "custom" | "none" | "daily" | "weekly" | "monthly";
repeatInterval: number;
repeatDays: string;
}[] | undefined;
}>;
lastPulledAt: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
changes: {
friendships?: {
id: string;
createdAt: number;
userId: string;
friendId: string;
status: "pending" | "accepted";
updatedAt: number;
}[] | undefined;
categories?: {
id: string;
name: string;
createdAt: number;
updatedAt: number;
color: string;
order?: number | undefined;
}[] | undefined;
tasks?: {
id: string;
createdAt: number;
updatedAt: number;
categoryId: string;
title: string;
completed: boolean;
description?: string | undefined;
priority?: "none" | "low" | "medium" | "high" | "critical" | undefined;
dueDate?: number | undefined;
dueTime?: string | null | undefined;
endTime?: string | undefined;
repeat?: "custom" | "none" | "daily" | "weekly" | "monthly" | undefined;
repeatInterval?: number | undefined;
repeatDays?: string | undefined;
seriesId?: string | undefined;
assigneeId?: string | null | undefined;
reminder?: "none" | "at_time" | "15" | "30" | "60" | "120" | "1440" | undefined;
subtasks?: {
title: string;
}[] | undefined;
}[] | undefined;
subtasks?: {
id: string;
createdAt: number;
updatedAt: number;
title: string;
completed: boolean;
taskId: string;
order?: number | undefined;
}[] | undefined;
repeatProfiles?: {
id: string;
name: string;
createdAt: number;
updatedAt: number;
repeat: "custom" | "none" | "daily" | "weekly" | "monthly";
repeatInterval: number;
repeatDays: string;
}[] | undefined;
};
lastPulledAt: number;
}, {
changes: {
friendships?: {
id: string;
createdAt: number;
userId: string;
friendId: string;
status: "pending" | "accepted";
updatedAt: number;
}[] | undefined;
categories?: {
id: string;
name: string;
createdAt: number;
updatedAt: number;
color: string;
order?: number | undefined;
}[] | undefined;
tasks?: {
id: string;
createdAt: number;
updatedAt: number;
categoryId: string;
title: string;
completed: boolean;
description?: string | undefined;
priority?: "none" | "low" | "medium" | "high" | "critical" | undefined;
dueDate?: number | undefined;
dueTime?: string | null | undefined;
endTime?: string | undefined;
repeat?: "custom" | "none" | "daily" | "weekly" | "monthly" | undefined;
repeatInterval?: number | undefined;
repeatDays?: string | undefined;
seriesId?: string | undefined;
assigneeId?: string | null | undefined;
reminder?: "none" | "at_time" | "15" | "30" | "60" | "120" | "1440" | undefined;
subtasks?: {
title: string;
}[] | undefined;
}[] | undefined;
subtasks?: {
id: string;
createdAt: number;
updatedAt: number;
title: string;
completed: boolean;
taskId: string;
order?: number | undefined;
}[] | undefined;
repeatProfiles?: {
id: string;
name: string;
createdAt: number;
updatedAt: number;
repeat: "custom" | "none" | "daily" | "weekly" | "monthly";
repeatInterval: number;
repeatDays: string;
}[] | undefined;
};
lastPulledAt: number;
}>;
export declare const syncQuerySchema: z.ZodObject<{
since: z.ZodPipeline<z.ZodEffects<z.ZodString, number, string>, z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
since: number;
}, {
since: string;
}>;
export declare const taskQuerySchema: z.ZodObject<{
categoryId: z.ZodOptional<z.ZodString>;
completed: z.ZodOptional<z.ZodEffects<z.ZodString, boolean, string>>;
dueBefore: z.ZodOptional<z.ZodPipeline<z.ZodEffects<z.ZodString, number, string>, z.ZodNumber>>;
dueAfter: z.ZodOptional<z.ZodPipeline<z.ZodEffects<z.ZodString, number, string>, z.ZodNumber>>;
priority: z.ZodOptional<z.ZodEnum<["none", "low", "medium", "high", "critical"]>>;
sortBy: z.ZodOptional<z.ZodEnum<["dueDate", "priority", "createdAt", "title"]>>;
sortOrder: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
limit: z.ZodOptional<z.ZodPipeline<z.ZodEffects<z.ZodString, number, string>, z.ZodNumber>>;
offset: z.ZodOptional<z.ZodPipeline<z.ZodEffects<z.ZodString, number, string>, z.ZodNumber>>;
}, "strip", z.ZodTypeAny, {
categoryId?: string | undefined;
priority?: "none" | "low" | "medium" | "high" | "critical" | undefined;
completed?: boolean | undefined;
sortBy?: "createdAt" | "title" | "priority" | "dueDate" | undefined;
sortOrder?: "asc" | "desc" | undefined;
limit?: number | undefined;
offset?: number | undefined;
dueBefore?: number | undefined;
dueAfter?: number | undefined;
}, {
categoryId?: string | undefined;
priority?: "none" | "low" | "medium" | "high" | "critical" | undefined;
completed?: string | undefined;
sortBy?: "createdAt" | "title" | "priority" | "dueDate" | undefined;
sortOrder?: "asc" | "desc" | undefined;
limit?: string | undefined;
offset?: string | undefined;
dueBefore?: string | undefined;
dueAfter?: string | undefined;
}>;
//# sourceMappingURL=validation.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/utils/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;EAI/B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;EAI/B,CAAC;AAEH,eAAO,MAAM,YAAY,6DAA2D,CAAC;AAErF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAe3B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU3B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;EAG9B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAI9B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;EAO7B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;EAK9B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;EAE9B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;EAO3B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS5B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;EAE1B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU1B,CAAC"}
+101
View File
@@ -0,0 +1,101 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.taskQuerySchema = exports.syncQuerySchema = exports.pushChangesSchema = exports.friendshipSchema = exports.friendRequestSchema = exports.repeatProfileSchema = exports.userSettingsSchema = exports.subtaskUpdateSchema = exports.subtaskCreateSchema = exports.taskUpdateSchema = exports.taskCreateSchema = exports.repeatSchema = exports.categoryUpdateSchema = exports.categoryCreateSchema = void 0;
const zod_1 = require("zod");
exports.categoryCreateSchema = zod_1.z.object({
name: zod_1.z.string().min(1).max(50),
color: zod_1.z.string().regex(/^#[0-9A-Fa-f]{6}$/),
order: zod_1.z.number().int().min(0).optional(),
});
exports.categoryUpdateSchema = zod_1.z.object({
name: zod_1.z.string().min(1).max(50).optional(),
color: zod_1.z.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
order: zod_1.z.number().int().min(0).optional(),
});
exports.repeatSchema = zod_1.z.enum(['none', 'daily', 'weekly', 'monthly', 'custom']);
exports.taskCreateSchema = zod_1.z.object({
title: zod_1.z.string().min(1).max(100),
description: zod_1.z.string().max(1000).optional(),
categoryId: zod_1.z.string().min(1),
priority: zod_1.z.enum(['none', 'low', 'medium', 'high', 'critical']).optional(),
dueDate: zod_1.z.number().int().min(0).optional(),
dueTime: zod_1.z.string().regex(/^([01]\d|2[0-3]):([0-5]\d)$/).optional().nullable(),
endTime: zod_1.z.string().regex(/^([01]\d|2[0-3]):([0-5]\d)$/).optional().or(zod_1.z.literal('')),
repeat: exports.repeatSchema.optional(),
repeatInterval: zod_1.z.number().int().min(1).max(30).optional(),
repeatDays: zod_1.z.string().max(20).optional(),
seriesId: zod_1.z.string().max(50).optional(),
reminder: zod_1.z.enum(['none', 'at_time', '15', '30', '60', '120', '1440']).optional(),
assigneeId: zod_1.z.string().nullable().optional(),
subtasks: zod_1.z.array(zod_1.z.object({ title: zod_1.z.string().min(1).max(100) })).optional(),
});
exports.taskUpdateSchema = zod_1.z.object({
title: zod_1.z.string().min(1).max(100).optional(),
description: zod_1.z.string().max(1000).optional(),
categoryId: zod_1.z.string().min(1).optional(),
priority: zod_1.z.enum(['none', 'low', 'medium', 'high', 'critical']).optional(),
completed: zod_1.z.boolean().optional(),
dueDate: zod_1.z.number().int().min(0).optional(),
dueTime: zod_1.z.string().regex(/^([01]\d|2[0-3]):([0-5]\d)$/).optional().nullable(),
endTime: zod_1.z.string().regex(/^([01]\d|2[0-3]):([0-5]\d)$/).optional(),
assigneeId: zod_1.z.string().nullable().optional(),
});
exports.subtaskCreateSchema = zod_1.z.object({
title: zod_1.z.string().min(1).max(100),
order: zod_1.z.number().int().min(0).optional(),
});
exports.subtaskUpdateSchema = zod_1.z.object({
title: zod_1.z.string().min(1).max(100).optional(),
completed: zod_1.z.boolean().optional(),
order: zod_1.z.number().int().min(0).optional(),
});
exports.userSettingsSchema = zod_1.z.object({
darkMode: zod_1.z.boolean().optional(),
notifications: zod_1.z.boolean().optional(),
reminderTime: zod_1.z.string().regex(/^([01]\d|2[0-3]):([0-5]\d)$/).optional(),
defaultCategory: zod_1.z.string().optional().nullable(),
sortBy: zod_1.z.enum(['dueDate', 'priority', 'title', 'createdAt']).optional(),
sortOrder: zod_1.z.enum(['asc', 'desc']).optional(),
});
exports.repeatProfileSchema = zod_1.z.object({
name: zod_1.z.string().min(1).max(50),
repeat: exports.repeatSchema,
repeatInterval: zod_1.z.number().int().min(1).max(30),
repeatDays: zod_1.z.string().max(20),
});
exports.friendRequestSchema = zod_1.z.object({
username: zod_1.z.string().min(1).max(50),
});
exports.friendshipSchema = zod_1.z.object({
id: zod_1.z.string(),
userId: zod_1.z.string(),
friendId: zod_1.z.string(),
status: zod_1.z.enum(['pending', 'accepted']),
createdAt: zod_1.z.number(),
updatedAt: zod_1.z.number(),
});
exports.pushChangesSchema = zod_1.z.object({
changes: zod_1.z.object({
categories: zod_1.z.array(exports.categoryCreateSchema.extend({ id: zod_1.z.string(), createdAt: zod_1.z.number(), updatedAt: zod_1.z.number() })).optional(),
tasks: zod_1.z.array(exports.taskCreateSchema.extend({ id: zod_1.z.string(), completed: zod_1.z.boolean(), createdAt: zod_1.z.number(), updatedAt: zod_1.z.number() })).optional(),
subtasks: zod_1.z.array(exports.subtaskCreateSchema.extend({ id: zod_1.z.string(), taskId: zod_1.z.string(), completed: zod_1.z.boolean(), createdAt: zod_1.z.number(), updatedAt: zod_1.z.number() })).optional(),
repeatProfiles: zod_1.z.array(exports.repeatProfileSchema.extend({ id: zod_1.z.string(), createdAt: zod_1.z.number(), updatedAt: zod_1.z.number() })).optional(),
friendships: zod_1.z.array(exports.friendshipSchema).optional(),
}),
lastPulledAt: zod_1.z.number().int().min(0),
});
exports.syncQuerySchema = zod_1.z.object({
since: zod_1.z.string().transform(Number).pipe(zod_1.z.number().int().min(0)),
});
exports.taskQuerySchema = zod_1.z.object({
categoryId: zod_1.z.string().optional(),
completed: zod_1.z.string().transform(v => v === 'true').optional(),
dueBefore: zod_1.z.string().transform(Number).pipe(zod_1.z.number().int().min(0)).optional(),
dueAfter: zod_1.z.string().transform(Number).pipe(zod_1.z.number().int().min(0)).optional(),
priority: zod_1.z.enum(['none', 'low', 'medium', 'high', 'critical']).optional(),
sortBy: zod_1.z.enum(['dueDate', 'priority', 'createdAt', 'title']).optional(),
sortOrder: zod_1.z.enum(['asc', 'desc']).optional(),
limit: zod_1.z.string().transform(Number).pipe(zod_1.z.number().int().min(1).max(100)).optional(),
offset: zod_1.z.string().transform(Number).pipe(zod_1.z.number().int().min(0)).optional(),
});
//# sourceMappingURL=validation.js.map
File diff suppressed because one or more lines are too long