@filcuk/planka-mcp 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +180 -0
  3. package/dist/client.d.ts +55 -0
  4. package/dist/client.d.ts.map +1 -0
  5. package/dist/client.js +193 -0
  6. package/dist/client.js.map +1 -0
  7. package/dist/errors.d.ts +39 -0
  8. package/dist/errors.d.ts.map +1 -0
  9. package/dist/errors.js +82 -0
  10. package/dist/errors.js.map +1 -0
  11. package/dist/index.d.ts +3 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +100 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/operations/boards.d.ts +39 -0
  16. package/dist/operations/boards.d.ts.map +1 -0
  17. package/dist/operations/boards.js +76 -0
  18. package/dist/operations/boards.js.map +1 -0
  19. package/dist/operations/cards.d.ts +35 -0
  20. package/dist/operations/cards.d.ts.map +1 -0
  21. package/dist/operations/cards.js +70 -0
  22. package/dist/operations/cards.js.map +1 -0
  23. package/dist/operations/comments.d.ts +20 -0
  24. package/dist/operations/comments.d.ts.map +1 -0
  25. package/dist/operations/comments.js +42 -0
  26. package/dist/operations/comments.js.map +1 -0
  27. package/dist/operations/labels.d.ts +32 -0
  28. package/dist/operations/labels.d.ts.map +1 -0
  29. package/dist/operations/labels.js +91 -0
  30. package/dist/operations/labels.js.map +1 -0
  31. package/dist/operations/lists.d.ts +15 -0
  32. package/dist/operations/lists.d.ts.map +1 -0
  33. package/dist/operations/lists.js +35 -0
  34. package/dist/operations/lists.js.map +1 -0
  35. package/dist/operations/projects.d.ts +23 -0
  36. package/dist/operations/projects.d.ts.map +1 -0
  37. package/dist/operations/projects.js +52 -0
  38. package/dist/operations/projects.js.map +1 -0
  39. package/dist/operations/tasks.d.ts +30 -0
  40. package/dist/operations/tasks.d.ts.map +1 -0
  41. package/dist/operations/tasks.js +102 -0
  42. package/dist/operations/tasks.js.map +1 -0
  43. package/dist/schemas/entities.d.ts +307 -0
  44. package/dist/schemas/entities.d.ts.map +1 -0
  45. package/dist/schemas/entities.js +168 -0
  46. package/dist/schemas/entities.js.map +1 -0
  47. package/dist/schemas/requests.d.ts +225 -0
  48. package/dist/schemas/requests.d.ts.map +1 -0
  49. package/dist/schemas/requests.js +87 -0
  50. package/dist/schemas/requests.js.map +1 -0
  51. package/dist/schemas/responses.d.ts +2161 -0
  52. package/dist/schemas/responses.d.ts.map +1 -0
  53. package/dist/schemas/responses.js +68 -0
  54. package/dist/schemas/responses.js.map +1 -0
  55. package/dist/tools/cards.d.ts +401 -0
  56. package/dist/tools/cards.d.ts.map +1 -0
  57. package/dist/tools/cards.js +367 -0
  58. package/dist/tools/cards.js.map +1 -0
  59. package/dist/tools/comments.d.ts +134 -0
  60. package/dist/tools/comments.d.ts.map +1 -0
  61. package/dist/tools/comments.js +109 -0
  62. package/dist/tools/comments.js.map +1 -0
  63. package/dist/tools/index.d.ts +790 -0
  64. package/dist/tools/index.d.ts.map +1 -0
  65. package/dist/tools/index.js +44 -0
  66. package/dist/tools/index.js.map +1 -0
  67. package/dist/tools/labels.d.ts +198 -0
  68. package/dist/tools/labels.d.ts.map +1 -0
  69. package/dist/tools/labels.js +265 -0
  70. package/dist/tools/labels.js.map +1 -0
  71. package/dist/tools/lists.d.ts +117 -0
  72. package/dist/tools/lists.d.ts.map +1 -0
  73. package/dist/tools/lists.js +178 -0
  74. package/dist/tools/lists.js.map +1 -0
  75. package/dist/tools/navigation.d.ts +106 -0
  76. package/dist/tools/navigation.d.ts.map +1 -0
  77. package/dist/tools/navigation.js +151 -0
  78. package/dist/tools/navigation.js.map +1 -0
  79. package/dist/tools/tasks.d.ts +223 -0
  80. package/dist/tools/tasks.d.ts.map +1 -0
  81. package/dist/tools/tasks.js +169 -0
  82. package/dist/tools/tasks.js.map +1 -0
  83. package/package.json +53 -0
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Project operations for PLANKA API.
3
+ */
4
+ import { plankaClient } from "../client.js";
5
+ import { ListSchema } from "../schemas/entities.js";
6
+ import { ProjectsResponse, ProjectsIncludedSchema } from "../schemas/responses.js";
7
+ import { z } from "zod";
8
+ /**
9
+ * Get all projects with their boards.
10
+ */
11
+ export async function getProjects() {
12
+ const response = await plankaClient.get("/api/projects");
13
+ const parsed = ProjectsResponse.parse(response);
14
+ const included = ProjectsIncludedSchema.parse(response.included || {});
15
+ return {
16
+ projects: parsed.items,
17
+ boards: included.boards || [],
18
+ };
19
+ }
20
+ /**
21
+ * Get the full structure: projects -> boards -> lists.
22
+ */
23
+ export async function getStructure(projectId) {
24
+ const { projects, boards } = await getProjects();
25
+ // Filter to specific project if requested
26
+ const targetProjects = projectId
27
+ ? projects.filter((p) => p.id === projectId)
28
+ : projects;
29
+ const structures = [];
30
+ for (const project of targetProjects) {
31
+ const projectBoards = boards.filter((b) => b.projectId === project.id);
32
+ const boardsWithLists = [];
33
+ for (const board of projectBoards) {
34
+ // Get board details to get lists
35
+ const boardResponse = await plankaClient.get(`/api/boards/${board.id}`);
36
+ const included = boardResponse.included;
37
+ const lists = included?.lists
38
+ ? z.array(ListSchema).parse(included.lists)
39
+ : [];
40
+ boardsWithLists.push({
41
+ board,
42
+ lists: lists.sort((a, b) => (a.position ?? 0) - (b.position ?? 0)),
43
+ });
44
+ }
45
+ structures.push({
46
+ project,
47
+ boards: boardsWithLists.sort((a, b) => a.board.position - b.board.position),
48
+ });
49
+ }
50
+ return structures;
51
+ }
52
+ //# sourceMappingURL=projects.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/operations/projects.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAwB,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,EAAE,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AAC;YACd,MAAM,KAAK,GAAG,QAAQ,EAAE,KAAK;gBAC3B,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC;gBAC3C,CAAC,CAAC,EAAE,CAAC;YAEP,eAAe,CAAC,IAAI,CAAC;gBACnB,KAAK;gBACL,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC;aACnE,CAAC,CAAC;QACL,CAAC;QAED,UAAU,CAAC,IAAI,CAAC;YACd,OAAO;YACP,MAAM,EAAE,eAAe,CAAC,IAAI,CAC1B,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,QAAQ,CAC9C;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { Task, TaskList } from "../schemas/entities.js";
2
+ import { CreateTaskInput, UpdateTaskInput, BatchCreateTasksInput } from "../schemas/requests.js";
3
+ /**
4
+ * Create a task-list on a card.
5
+ */
6
+ export declare function createTaskList(cardId: string, name: string, position?: number): Promise<TaskList>;
7
+ /**
8
+ * Create a single task on a card.
9
+ * Automatically creates a default task-list if the card doesn't have one.
10
+ */
11
+ export declare function createTask(input: CreateTaskInput): Promise<Task>;
12
+ /**
13
+ * Create multiple tasks on a card.
14
+ * Tasks are created in order with automatically calculated positions.
15
+ * Automatically creates a default task-list if the card doesn't have one.
16
+ */
17
+ export declare function createTasks(input: BatchCreateTasksInput): Promise<Task[]>;
18
+ /**
19
+ * Update a task's properties.
20
+ */
21
+ export declare function updateTask(taskId: string, input: UpdateTaskInput): Promise<Task>;
22
+ /**
23
+ * Delete a task.
24
+ */
25
+ export declare function deleteTask(taskId: string): Promise<void>;
26
+ /**
27
+ * Delete a task-list and all its tasks.
28
+ */
29
+ export declare function deleteTaskList(taskListId: string): Promise<void>;
30
+ //# sourceMappingURL=tasks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/operations/tasks.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAIL,eAAe,EACf,eAAe,EACf,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AAiChC;;GAEG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,QAAQ,CAAC,CAWnB;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBtE;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAwB/E;AAED;;GAEG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,eAAe,GACrB,OAAO,CAAC,IAAI,CAAC,CAUf;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE9D;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEtE"}
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Task (checklist item) operations for PLANKA 2.0 API.
3
+ *
4
+ * PLANKA 2.0 introduced task-lists (checklists) as containers for tasks.
5
+ * This module provides a convenience layer that auto-creates a default
6
+ * task-list when adding tasks to a card that doesn't have one.
7
+ */
8
+ import { plankaClient } from "../client.js";
9
+ import { CreateTaskSchema, UpdateTaskSchema, BatchCreateTasksSchema, } from "../schemas/requests.js";
10
+ import { TaskResponse, TaskListResponse } from "../schemas/responses.js";
11
+ import { getCard } from "./cards.js";
12
+ const DEFAULT_TASK_LIST_NAME = "Tasks";
13
+ /**
14
+ * Get or create a default task-list for a card.
15
+ * If the card has no task-lists, creates one called "Tasks".
16
+ */
17
+ async function getOrCreateDefaultTaskList(cardId) {
18
+ // Fetch card to see existing task-lists
19
+ const cardDetails = await getCard(cardId);
20
+ // Check if there's an existing task-list
21
+ if (cardDetails.taskLists && cardDetails.taskLists.length > 0) {
22
+ // Return the first task-list (sorted by position)
23
+ return cardDetails.taskLists.sort((a, b) => a.position - b.position)[0];
24
+ }
25
+ // Create a default task-list
26
+ const response = await plankaClient.post(`/api/cards/${cardId}/task-lists`, {
27
+ name: DEFAULT_TASK_LIST_NAME,
28
+ position: 65536,
29
+ });
30
+ const parsed = TaskListResponse.parse(response);
31
+ return parsed.item;
32
+ }
33
+ /**
34
+ * Create a task-list on a card.
35
+ */
36
+ export async function createTaskList(cardId, name, position) {
37
+ const response = await plankaClient.post(`/api/cards/${cardId}/task-lists`, {
38
+ name,
39
+ position: position ?? 65536,
40
+ });
41
+ const parsed = TaskListResponse.parse(response);
42
+ return parsed.item;
43
+ }
44
+ /**
45
+ * Create a single task on a card.
46
+ * Automatically creates a default task-list if the card doesn't have one.
47
+ */
48
+ export async function createTask(input) {
49
+ const validated = CreateTaskSchema.parse(input);
50
+ // Get or create a task-list for this card
51
+ const taskList = await getOrCreateDefaultTaskList(validated.cardId);
52
+ const response = await plankaClient.post(`/api/task-lists/${taskList.id}/tasks`, {
53
+ name: validated.name,
54
+ position: validated.position,
55
+ });
56
+ const parsed = TaskResponse.parse(response);
57
+ return parsed.item;
58
+ }
59
+ /**
60
+ * Create multiple tasks on a card.
61
+ * Tasks are created in order with automatically calculated positions.
62
+ * Automatically creates a default task-list if the card doesn't have one.
63
+ */
64
+ export async function createTasks(input) {
65
+ const validated = BatchCreateTasksSchema.parse(input);
66
+ // Get or create a task-list for this card
67
+ const taskList = await getOrCreateDefaultTaskList(validated.cardId);
68
+ const tasks = [];
69
+ let position = 65536;
70
+ for (const taskInput of validated.tasks) {
71
+ const response = await plankaClient.post(`/api/task-lists/${taskList.id}/tasks`, {
72
+ name: taskInput.name,
73
+ position: taskInput.position ?? position,
74
+ });
75
+ const parsed = TaskResponse.parse(response);
76
+ tasks.push(parsed.item);
77
+ position += 65536;
78
+ }
79
+ return tasks;
80
+ }
81
+ /**
82
+ * Update a task's properties.
83
+ */
84
+ export async function updateTask(taskId, input) {
85
+ const validated = UpdateTaskSchema.parse(input);
86
+ const response = await plankaClient.patch(`/api/tasks/${taskId}`, validated);
87
+ const parsed = TaskResponse.parse(response);
88
+ return parsed.item;
89
+ }
90
+ /**
91
+ * Delete a task.
92
+ */
93
+ export async function deleteTask(taskId) {
94
+ await plankaClient.delete(`/api/tasks/${taskId}`);
95
+ }
96
+ /**
97
+ * Delete a task-list and all its tasks.
98
+ */
99
+ export async function deleteTaskList(taskListId) {
100
+ await plankaClient.delete(`/api/task-lists/${taskListId}`);
101
+ }
102
+ //# sourceMappingURL=tasks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../src/operations/tasks.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,GAIvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,MAAM,sBAAsB,GAAG,OAAO,CAAC;AAEvC;;;GAGG;AACH,KAAK,UAAU,0BAA0B,CAAC,MAAc;IACtD,wCAAwC;IACxC,MAAM,WAAW,GA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c,MAAM,EAAE,EACtB,SAAS,CACV,CAAC;IAEF,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC5C,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,MAAc;IAC7C,MAAM,YAAY,CAAC,MAAM,CAAC,cAAc,MAAM,EAAE,CAAC,CAAC;AACpD,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,UAAkB;IACrD,MAAM,YAAY,CAAC,MAAM,CAAC,mBAAmB,UAAU,EAAE,CAAC,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,307 @@
1
+ /**
2
+ * Core entity schemas for PLANKA 2.0
3
+ * All types are derived from these Zod schemas.
4
+ */
5
+ import { z } from "zod";
6
+ export declare const CardTypeSchema: z.ZodEnum<["project", "story"]>;
7
+ export type CardType = z.infer<typeof CardTypeSchema>;
8
+ export declare const ListTypeSchema: z.ZodEnum<["active", "closed", "archive", "trash"]>;
9
+ export type ListType = z.infer<typeof ListTypeSchema>;
10
+ export declare const LabelColorSchema: z.ZodEnum<["muddy-grey", "autumn-leafs", "morning-sky", "antique-blue", "egg-yellow", "desert-sand", "dark-granite", "fresh-salad", "lagoon-blue", "midnight-blue", "light-orange", "pumpkin-orange", "light-concrete", "sunny-grass", "navy-blue", "lilac-eyes", "apricot-red", "orange-peel", "silver-glint", "bright-moss", "deep-ocean", "summer-sky", "berry-red", "light-cocoa", "grey-stone", "tank-green", "coral-green", "sugar-plum", "pink-tulip", "shady-rust", "wet-rock", "wet-moss", "turquoise-sea", "lavender-fields", "piggy-red", "light-mud", "gun-metal", "modern-green", "french-coast", "sweet-lilac", "red-burgundy", "pirate-gold"]>;
11
+ export type LabelColor = z.infer<typeof LabelColorSchema>;
12
+ export declare const UserSchema: z.ZodObject<{
13
+ id: z.ZodString;
14
+ email: z.ZodOptional<z.ZodString>;
15
+ username: z.ZodOptional<z.ZodString>;
16
+ name: z.ZodString;
17
+ avatarUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
18
+ createdAt: z.ZodString;
19
+ updatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20
+ }, "strip", z.ZodTypeAny, {
21
+ id: string;
22
+ name: string;
23
+ createdAt: string;
24
+ email?: string | undefined;
25
+ username?: string | undefined;
26
+ avatarUrl?: string | null | undefined;
27
+ updatedAt?: string | null | undefined;
28
+ }, {
29
+ id: string;
30
+ name: string;
31
+ createdAt: string;
32
+ email?: string | undefined;
33
+ username?: string | undefined;
34
+ avatarUrl?: string | null | undefined;
35
+ updatedAt?: string | null | undefined;
36
+ }>;
37
+ export type User = z.infer<typeof UserSchema>;
38
+ export declare const ProjectSchema: z.ZodObject<{
39
+ id: z.ZodString;
40
+ name: z.ZodString;
41
+ background: z.ZodOptional<z.ZodNullable<z.ZodString>>;
42
+ backgroundImage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
43
+ createdAt: z.ZodString;
44
+ updatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
45
+ }, "strip", z.ZodTypeAny, {
46
+ id: string;
47
+ name: string;
48
+ createdAt: string;
49
+ updatedAt?: string | null | undefined;
50
+ background?: string | null | undefined;
51
+ backgroundImage?: string | null | undefined;
52
+ }, {
53
+ id: string;
54
+ name: string;
55
+ createdAt: string;
56
+ updatedAt?: string | null | undefined;
57
+ background?: string | null | undefined;
58
+ backgroundImage?: string | null | undefined;
59
+ }>;
60
+ export type Project = z.infer<typeof ProjectSchema>;
61
+ export declare const BoardSchema: z.ZodObject<{
62
+ id: z.ZodString;
63
+ projectId: z.ZodString;
64
+ name: z.ZodString;
65
+ position: z.ZodNumber;
66
+ createdAt: z.ZodString;
67
+ updatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
68
+ }, "strip", z.ZodTypeAny, {
69
+ id: string;
70
+ name: string;
71
+ createdAt: string;
72
+ projectId: string;
73
+ position: number;
74
+ updatedAt?: string | null | undefined;
75
+ }, {
76
+ id: string;
77
+ name: string;
78
+ createdAt: string;
79
+ projectId: string;
80
+ position: number;
81
+ updatedAt?: string | null | undefined;
82
+ }>;
83
+ export type Board = z.infer<typeof BoardSchema>;
84
+ export declare const ListSchema: z.ZodObject<{
85
+ id: z.ZodString;
86
+ boardId: z.ZodString;
87
+ type: z.ZodEnum<["active", "closed", "archive", "trash"]>;
88
+ name: z.ZodNullable<z.ZodString>;
89
+ position: z.ZodNullable<z.ZodNumber>;
90
+ color: z.ZodOptional<z.ZodNullable<z.ZodEnum<["muddy-grey", "autumn-leafs", "morning-sky", "antique-blue", "egg-yellow", "desert-sand", "dark-granite", "fresh-salad", "lagoon-blue", "midnight-blue", "light-orange", "pumpkin-orange", "light-concrete", "sunny-grass", "navy-blue", "lilac-eyes", "apricot-red", "orange-peel", "silver-glint", "bright-moss", "deep-ocean", "summer-sky", "berry-red", "light-cocoa", "grey-stone", "tank-green", "coral-green", "sugar-plum", "pink-tulip", "shady-rust", "wet-rock", "wet-moss", "turquoise-sea", "lavender-fields", "piggy-red", "light-mud", "gun-metal", "modern-green", "french-coast", "sweet-lilac", "red-burgundy", "pirate-gold"]>>>;
91
+ createdAt: z.ZodString;
92
+ updatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
93
+ }, "strip", z.ZodTypeAny, {
94
+ type: "active" | "closed" | "archive" | "trash";
95
+ id: string;
96
+ name: string | null;
97
+ createdAt: string;
98
+ position: number | null;
99
+ boardId: string;
100
+ updatedAt?: string | null | undefined;
101
+ color?: "muddy-grey" | "autumn-leafs" | "morning-sky" | "antique-blue" | "egg-yellow" | "desert-sand" | "dark-granite" | "fresh-salad" | "lagoon-blue" | "midnight-blue" | "light-orange" | "pumpkin-orange" | "light-concrete" | "sunny-grass" | "navy-blue" | "lilac-eyes" | "apricot-red" | "orange-peel" | "silver-glint" | "bright-moss" | "deep-ocean" | "summer-sky" | "berry-red" | "light-cocoa" | "grey-stone" | "tank-green" | "coral-green" | "sugar-plum" | "pink-tulip" | "shady-rust" | "wet-rock" | "wet-moss" | "turquoise-sea" | "lavender-fields" | "piggy-red" | "light-mud" | "gun-metal" | "modern-green" | "french-coast" | "sweet-lilac" | "red-burgundy" | "pirate-gold" | null | undefined;
102
+ }, {
103
+ type: "active" | "closed" | "archive" | "trash";
104
+ id: string;
105
+ name: string | null;
106
+ createdAt: string;
107
+ position: number | null;
108
+ boardId: string;
109
+ updatedAt?: string | null | undefined;
110
+ color?: "muddy-grey" | "autumn-leafs" | "morning-sky" | "antique-blue" | "egg-yellow" | "desert-sand" | "dark-granite" | "fresh-salad" | "lagoon-blue" | "midnight-blue" | "light-orange" | "pumpkin-orange" | "light-concrete" | "sunny-grass" | "navy-blue" | "lilac-eyes" | "apricot-red" | "orange-peel" | "silver-glint" | "bright-moss" | "deep-ocean" | "summer-sky" | "berry-red" | "light-cocoa" | "grey-stone" | "tank-green" | "coral-green" | "sugar-plum" | "pink-tulip" | "shady-rust" | "wet-rock" | "wet-moss" | "turquoise-sea" | "lavender-fields" | "piggy-red" | "light-mud" | "gun-metal" | "modern-green" | "french-coast" | "sweet-lilac" | "red-burgundy" | "pirate-gold" | null | undefined;
111
+ }>;
112
+ export type List = z.infer<typeof ListSchema>;
113
+ export declare const CardSchema: z.ZodObject<{
114
+ id: z.ZodString;
115
+ boardId: z.ZodString;
116
+ listId: z.ZodString;
117
+ creatorUserId: z.ZodOptional<z.ZodString>;
118
+ name: z.ZodString;
119
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
120
+ position: z.ZodNumber;
121
+ type: z.ZodEnum<["project", "story"]>;
122
+ dueDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
123
+ isDueDateCompleted: z.ZodOptional<z.ZodBoolean>;
124
+ isCompleted: z.ZodOptional<z.ZodBoolean>;
125
+ createdAt: z.ZodString;
126
+ updatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
127
+ }, "strip", z.ZodTypeAny, {
128
+ type: "project" | "story";
129
+ id: string;
130
+ name: string;
131
+ createdAt: string;
132
+ position: number;
133
+ boardId: string;
134
+ listId: string;
135
+ updatedAt?: string | null | undefined;
136
+ creatorUserId?: string | undefined;
137
+ description?: string | null | undefined;
138
+ dueDate?: string | null | undefined;
139
+ isDueDateCompleted?: boolean | undefined;
140
+ isCompleted?: boolean | undefined;
141
+ }, {
142
+ type: "project" | "story";
143
+ id: string;
144
+ name: string;
145
+ createdAt: string;
146
+ position: number;
147
+ boardId: string;
148
+ listId: string;
149
+ updatedAt?: string | null | undefined;
150
+ creatorUserId?: string | undefined;
151
+ description?: string | null | undefined;
152
+ dueDate?: string | null | undefined;
153
+ isDueDateCompleted?: boolean | undefined;
154
+ isCompleted?: boolean | undefined;
155
+ }>;
156
+ export type Card = z.infer<typeof CardSchema>;
157
+ export declare const TaskListSchema: z.ZodObject<{
158
+ id: z.ZodString;
159
+ cardId: z.ZodString;
160
+ name: z.ZodString;
161
+ position: z.ZodNumber;
162
+ showOnFrontOfCard: z.ZodOptional<z.ZodBoolean>;
163
+ createdAt: z.ZodString;
164
+ updatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
165
+ }, "strip", z.ZodTypeAny, {
166
+ id: string;
167
+ name: string;
168
+ createdAt: string;
169
+ position: number;
170
+ cardId: string;
171
+ updatedAt?: string | null | undefined;
172
+ showOnFrontOfCard?: boolean | undefined;
173
+ }, {
174
+ id: string;
175
+ name: string;
176
+ createdAt: string;
177
+ position: number;
178
+ cardId: string;
179
+ updatedAt?: string | null | undefined;
180
+ showOnFrontOfCard?: boolean | undefined;
181
+ }>;
182
+ export type TaskList = z.infer<typeof TaskListSchema>;
183
+ export declare const TaskSchema: z.ZodObject<{
184
+ id: z.ZodString;
185
+ taskListId: z.ZodString;
186
+ name: z.ZodString;
187
+ position: z.ZodNumber;
188
+ isCompleted: z.ZodBoolean;
189
+ assigneeUserId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
190
+ createdAt: z.ZodString;
191
+ updatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
192
+ }, "strip", z.ZodTypeAny, {
193
+ id: string;
194
+ name: string;
195
+ createdAt: string;
196
+ position: number;
197
+ isCompleted: boolean;
198
+ taskListId: string;
199
+ updatedAt?: string | null | undefined;
200
+ assigneeUserId?: string | null | undefined;
201
+ }, {
202
+ id: string;
203
+ name: string;
204
+ createdAt: string;
205
+ position: number;
206
+ isCompleted: boolean;
207
+ taskListId: string;
208
+ updatedAt?: string | null | undefined;
209
+ assigneeUserId?: string | null | undefined;
210
+ }>;
211
+ export type Task = z.infer<typeof TaskSchema>;
212
+ export declare const LabelSchema: z.ZodObject<{
213
+ id: z.ZodString;
214
+ boardId: z.ZodString;
215
+ name: z.ZodNullable<z.ZodString>;
216
+ color: z.ZodEnum<["muddy-grey", "autumn-leafs", "morning-sky", "antique-blue", "egg-yellow", "desert-sand", "dark-granite", "fresh-salad", "lagoon-blue", "midnight-blue", "light-orange", "pumpkin-orange", "light-concrete", "sunny-grass", "navy-blue", "lilac-eyes", "apricot-red", "orange-peel", "silver-glint", "bright-moss", "deep-ocean", "summer-sky", "berry-red", "light-cocoa", "grey-stone", "tank-green", "coral-green", "sugar-plum", "pink-tulip", "shady-rust", "wet-rock", "wet-moss", "turquoise-sea", "lavender-fields", "piggy-red", "light-mud", "gun-metal", "modern-green", "french-coast", "sweet-lilac", "red-burgundy", "pirate-gold"]>;
217
+ position: z.ZodNumber;
218
+ createdAt: z.ZodString;
219
+ updatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
220
+ }, "strip", z.ZodTypeAny, {
221
+ id: string;
222
+ name: string | null;
223
+ createdAt: string;
224
+ position: number;
225
+ boardId: string;
226
+ color: "muddy-grey" | "autumn-leafs" | "morning-sky" | "antique-blue" | "egg-yellow" | "desert-sand" | "dark-granite" | "fresh-salad" | "lagoon-blue" | "midnight-blue" | "light-orange" | "pumpkin-orange" | "light-concrete" | "sunny-grass" | "navy-blue" | "lilac-eyes" | "apricot-red" | "orange-peel" | "silver-glint" | "bright-moss" | "deep-ocean" | "summer-sky" | "berry-red" | "light-cocoa" | "grey-stone" | "tank-green" | "coral-green" | "sugar-plum" | "pink-tulip" | "shady-rust" | "wet-rock" | "wet-moss" | "turquoise-sea" | "lavender-fields" | "piggy-red" | "light-mud" | "gun-metal" | "modern-green" | "french-coast" | "sweet-lilac" | "red-burgundy" | "pirate-gold";
227
+ updatedAt?: string | null | undefined;
228
+ }, {
229
+ id: string;
230
+ name: string | null;
231
+ createdAt: string;
232
+ position: number;
233
+ boardId: string;
234
+ color: "muddy-grey" | "autumn-leafs" | "morning-sky" | "antique-blue" | "egg-yellow" | "desert-sand" | "dark-granite" | "fresh-salad" | "lagoon-blue" | "midnight-blue" | "light-orange" | "pumpkin-orange" | "light-concrete" | "sunny-grass" | "navy-blue" | "lilac-eyes" | "apricot-red" | "orange-peel" | "silver-glint" | "bright-moss" | "deep-ocean" | "summer-sky" | "berry-red" | "light-cocoa" | "grey-stone" | "tank-green" | "coral-green" | "sugar-plum" | "pink-tulip" | "shady-rust" | "wet-rock" | "wet-moss" | "turquoise-sea" | "lavender-fields" | "piggy-red" | "light-mud" | "gun-metal" | "modern-green" | "french-coast" | "sweet-lilac" | "red-burgundy" | "pirate-gold";
235
+ updatedAt?: string | null | undefined;
236
+ }>;
237
+ export type Label = z.infer<typeof LabelSchema>;
238
+ export declare const CardLabelSchema: z.ZodObject<{
239
+ id: z.ZodString;
240
+ cardId: z.ZodString;
241
+ labelId: z.ZodString;
242
+ createdAt: z.ZodString;
243
+ updatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
244
+ }, "strip", z.ZodTypeAny, {
245
+ id: string;
246
+ createdAt: string;
247
+ cardId: string;
248
+ labelId: string;
249
+ updatedAt?: string | null | undefined;
250
+ }, {
251
+ id: string;
252
+ createdAt: string;
253
+ cardId: string;
254
+ labelId: string;
255
+ updatedAt?: string | null | undefined;
256
+ }>;
257
+ export type CardLabel = z.infer<typeof CardLabelSchema>;
258
+ export declare const CommentSchema: z.ZodObject<{
259
+ id: z.ZodString;
260
+ cardId: z.ZodString;
261
+ userId: z.ZodString;
262
+ text: z.ZodString;
263
+ createdAt: z.ZodString;
264
+ updatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
265
+ }, "strip", z.ZodTypeAny, {
266
+ id: string;
267
+ createdAt: string;
268
+ cardId: string;
269
+ userId: string;
270
+ text: string;
271
+ updatedAt?: string | null | undefined;
272
+ }, {
273
+ id: string;
274
+ createdAt: string;
275
+ cardId: string;
276
+ userId: string;
277
+ text: string;
278
+ updatedAt?: string | null | undefined;
279
+ }>;
280
+ export type Comment = z.infer<typeof CommentSchema>;
281
+ export declare const AttachmentSchema: z.ZodObject<{
282
+ id: z.ZodString;
283
+ cardId: z.ZodString;
284
+ creatorUserId: z.ZodOptional<z.ZodString>;
285
+ name: z.ZodString;
286
+ url: z.ZodOptional<z.ZodString>;
287
+ createdAt: z.ZodString;
288
+ updatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
289
+ }, "strip", z.ZodTypeAny, {
290
+ id: string;
291
+ name: string;
292
+ createdAt: string;
293
+ cardId: string;
294
+ updatedAt?: string | null | undefined;
295
+ creatorUserId?: string | undefined;
296
+ url?: string | undefined;
297
+ }, {
298
+ id: string;
299
+ name: string;
300
+ createdAt: string;
301
+ cardId: string;
302
+ updatedAt?: string | null | undefined;
303
+ creatorUserId?: string | undefined;
304
+ url?: string | undefined;
305
+ }>;
306
+ export type Attachment = z.infer<typeof AttachmentSchema>;
307
+ //# sourceMappingURL=entities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../src/schemas/entities.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,cAAc,iCAA+B,CAAC;AAC3D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc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