@omnicoreos/planka-mcp 0.2.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.
- package/CHANGELOG.md +86 -0
- package/CONTRIBUTING.md +37 -0
- package/CREDITS.md +39 -0
- package/LICENSE +22 -0
- package/README.es.md +213 -0
- package/README.md +213 -0
- package/dist/client.d.ts +96 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +281 -0
- package/dist/client.js.map +1 -0
- package/dist/errors.d.ts +85 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +226 -0
- package/dist/errors.js.map +1 -0
- package/dist/identity.generated.d.ts +3 -0
- package/dist/identity.generated.d.ts.map +1 -0
- package/dist/identity.generated.js +4 -0
- package/dist/identity.generated.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +93 -0
- package/dist/index.js.map +1 -0
- package/dist/operations/attachments.d.ts +34 -0
- package/dist/operations/attachments.d.ts.map +1 -0
- package/dist/operations/attachments.js +89 -0
- package/dist/operations/attachments.js.map +1 -0
- package/dist/operations/board-id.d.ts +9 -0
- package/dist/operations/board-id.d.ts.map +1 -0
- package/dist/operations/board-id.js +86 -0
- package/dist/operations/board-id.js.map +1 -0
- package/dist/operations/boards.d.ts +143 -0
- package/dist/operations/boards.d.ts.map +1 -0
- package/dist/operations/boards.js +391 -0
- package/dist/operations/boards.js.map +1 -0
- package/dist/operations/cards.d.ts +36 -0
- package/dist/operations/cards.d.ts.map +1 -0
- package/dist/operations/cards.js +81 -0
- package/dist/operations/cards.js.map +1 -0
- package/dist/operations/comments.d.ts +28 -0
- package/dist/operations/comments.d.ts.map +1 -0
- package/dist/operations/comments.js +53 -0
- package/dist/operations/comments.js.map +1 -0
- package/dist/operations/labels.d.ts +60 -0
- package/dist/operations/labels.d.ts.map +1 -0
- package/dist/operations/labels.js +146 -0
- package/dist/operations/labels.js.map +1 -0
- package/dist/operations/lists.d.ts +15 -0
- package/dist/operations/lists.d.ts.map +1 -0
- package/dist/operations/lists.js +40 -0
- package/dist/operations/lists.js.map +1 -0
- package/dist/operations/projects.d.ts +24 -0
- package/dist/operations/projects.d.ts.map +1 -0
- package/dist/operations/projects.js +61 -0
- package/dist/operations/projects.js.map +1 -0
- package/dist/operations/tasks.d.ts +30 -0
- package/dist/operations/tasks.d.ts.map +1 -0
- package/dist/operations/tasks.js +111 -0
- package/dist/operations/tasks.js.map +1 -0
- package/dist/schemas/entities.d.ts +389 -0
- package/dist/schemas/entities.d.ts.map +1 -0
- package/dist/schemas/entities.js +202 -0
- package/dist/schemas/entities.js.map +1 -0
- package/dist/schemas/requests.d.ts +539 -0
- package/dist/schemas/requests.d.ts.map +1 -0
- package/dist/schemas/requests.js +187 -0
- package/dist/schemas/requests.js.map +1 -0
- package/dist/schemas/responses.d.ts +2626 -0
- package/dist/schemas/responses.d.ts.map +1 -0
- package/dist/schemas/responses.js +75 -0
- package/dist/schemas/responses.js.map +1 -0
- package/dist/tools/attachments.d.ts +270 -0
- package/dist/tools/attachments.d.ts.map +1 -0
- package/dist/tools/attachments.js +247 -0
- package/dist/tools/attachments.js.map +1 -0
- package/dist/tools/cards.d.ts +401 -0
- package/dist/tools/cards.d.ts.map +1 -0
- package/dist/tools/cards.js +368 -0
- package/dist/tools/cards.js.map +1 -0
- package/dist/tools/comments.d.ts +217 -0
- package/dist/tools/comments.d.ts.map +1 -0
- package/dist/tools/comments.js +208 -0
- package/dist/tools/comments.js.map +1 -0
- package/dist/tools/index.d.ts +1293 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +62 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/labels.d.ts +214 -0
- package/dist/tools/labels.d.ts.map +1 -0
- package/dist/tools/labels.js +302 -0
- package/dist/tools/labels.js.map +1 -0
- package/dist/tools/lists.d.ts +117 -0
- package/dist/tools/lists.d.ts.map +1 -0
- package/dist/tools/lists.js +178 -0
- package/dist/tools/lists.js.map +1 -0
- package/dist/tools/navigation.d.ts +106 -0
- package/dist/tools/navigation.d.ts.map +1 -0
- package/dist/tools/navigation.js +151 -0
- package/dist/tools/navigation.js.map +1 -0
- package/dist/tools/queries.d.ts +380 -0
- package/dist/tools/queries.d.ts.map +1 -0
- package/dist/tools/queries.js +256 -0
- package/dist/tools/queries.js.map +1 -0
- package/dist/tools/tasks.d.ts +223 -0
- package/dist/tools/tasks.d.ts.map +1 -0
- package/dist/tools/tasks.js +169 -0
- package/dist/tools/tasks.js.map +1 -0
- package/docs/planka-2x-gotchas.md +192 -0
- package/docs/tools.md +659 -0
- package/docs/troubleshooting.md +138 -0
- package/package.json +71 -0
- package/project.identity.json +7 -0
- package/scripts/bootstrap-board.mjs +160 -0
- package/scripts/lib/planka-api.mjs +244 -0
- package/scripts/lib/workflow-template.mjs +26 -0
- package/scripts/setup.mjs +236 -0
- package/scripts/setup.sh +48 -0
- package/scripts/sync-identity.mjs +57 -0
- package/server.json +43 -0
- package/tests/smoke/planka-smoke.mjs +920 -0
- package/workflow/README.md +232 -0
- package/workflow/board-template.md +115 -0
- package/workflow/skills/planka-close-card/SKILL.md +81 -0
- package/workflow/skills/planka-orchestrator/SKILL.md +126 -0
- package/workflow/worktrees/README.md +104 -0
- package/workflow/worktrees/wt.conf.example +24 -0
- package/workflow/worktrees/wt.sh +345 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Card operations for PLANKA API.
|
|
3
|
+
*/
|
|
4
|
+
import { plankaClient } from "../client.js";
|
|
5
|
+
import { parseInput } from "../errors.js";
|
|
6
|
+
import { CardIdSchema, CreateCardSchema, MoveCardSchema, UpdateCardParamsSchema, } from "../schemas/requests.js";
|
|
7
|
+
import { CardResponse, CardIncludedSchema } from "../schemas/responses.js";
|
|
8
|
+
import { getCommentsForCard } from "./comments.js";
|
|
9
|
+
/**
|
|
10
|
+
* Create a new card in a list.
|
|
11
|
+
*/
|
|
12
|
+
export async function createCard(input) {
|
|
13
|
+
const validated = parseInput(CreateCardSchema, input);
|
|
14
|
+
const response = await plankaClient.post(`/api/lists/${validated.listId}/cards`, {
|
|
15
|
+
name: validated.name,
|
|
16
|
+
description: validated.description,
|
|
17
|
+
position: validated.position,
|
|
18
|
+
type: validated.type, // Required for PLANKA 2.0
|
|
19
|
+
dueDate: validated.dueDate,
|
|
20
|
+
});
|
|
21
|
+
const parsed = CardResponse.parse(response);
|
|
22
|
+
return parsed.item;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get a card by ID with all related entities.
|
|
26
|
+
*/
|
|
27
|
+
export async function getCard(input) {
|
|
28
|
+
const { cardId } = parseInput(CardIdSchema, input);
|
|
29
|
+
// PLANKA 2.x doesn't include comments in the card response; fetch them
|
|
30
|
+
// from their own endpoint alongside. Fall back to `included` (pre-2.x)
|
|
31
|
+
// if that endpoint fails.
|
|
32
|
+
const [response, fetchedComments] = await Promise.all([
|
|
33
|
+
plankaClient.get(`/api/cards/${cardId}`),
|
|
34
|
+
getCommentsForCard({ cardId }).catch(() => null),
|
|
35
|
+
]);
|
|
36
|
+
const parsed = CardResponse.parse(response);
|
|
37
|
+
const included = CardIncludedSchema.parse(response.included || {});
|
|
38
|
+
return {
|
|
39
|
+
card: parsed.item,
|
|
40
|
+
taskLists: (included.taskLists || []).sort((a, b) => a.position - b.position),
|
|
41
|
+
tasks: (included.tasks || []).sort((a, b) => a.position - b.position),
|
|
42
|
+
comments: fetchedComments ??
|
|
43
|
+
(included.comments || []).sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()),
|
|
44
|
+
labels: included.labels || [],
|
|
45
|
+
cardLabels: included.cardLabels || [],
|
|
46
|
+
attachments: included.attachments || [],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Update a card's properties.
|
|
51
|
+
*/
|
|
52
|
+
export async function updateCard(input) {
|
|
53
|
+
const { cardId, ...updates } = parseInput(UpdateCardParamsSchema, input);
|
|
54
|
+
const response = await plankaClient.patch(`/api/cards/${cardId}`, updates);
|
|
55
|
+
const parsed = CardResponse.parse(response);
|
|
56
|
+
return parsed.item;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Move a card to a different list/position.
|
|
60
|
+
*/
|
|
61
|
+
export async function moveCard(input) {
|
|
62
|
+
const validated = parseInput(MoveCardSchema, input);
|
|
63
|
+
const updatePayload = {
|
|
64
|
+
listId: validated.listId,
|
|
65
|
+
position: validated.position,
|
|
66
|
+
};
|
|
67
|
+
if (validated.boardId) {
|
|
68
|
+
updatePayload.boardId = validated.boardId;
|
|
69
|
+
}
|
|
70
|
+
const response = await plankaClient.patch(`/api/cards/${validated.cardId}`, updatePayload);
|
|
71
|
+
const parsed = CardResponse.parse(response);
|
|
72
|
+
return parsed.item;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Delete a card.
|
|
76
|
+
*/
|
|
77
|
+
export async function deleteCard(input) {
|
|
78
|
+
const { cardId } = parseInput(CardIdSchema, input);
|
|
79
|
+
await plankaClient.delete(`/api/cards/${cardId}`);
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=cards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cards.js","sourceRoot":"","sources":["../../src/operations/cards.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EACL,YAAY,EAEZ,gBAAgB,EAEhB,cAAc,EAEd,sBAAsB,GAEvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAqB,MAAM,eAAe,CAAC;AAetE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,KAAsB;IACrD,MAAM,SAAS,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AAM;QACxB,QAAQ,EAAE,SAAS,CAAC,QAAQ;KAC7B,CAAC;IAEF,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC;QACtB,aAAa,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC;IAC5C,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,KAAK,CACvC,cAAc,SAAS,CAAC,MAAM,EAAE,EAChC,aAAa,CACd,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,KAAkB;IACjD,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IACnD,MAAM,YAAY,CAAC,MAAM,CAAC,cAAc,MAAM,EAAE,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Comment } from "../schemas/entities.js";
|
|
2
|
+
import { CardIdInput, CommentIdInput, CreateCommentInput, UpdateCommentParamsInput } from "../schemas/requests.js";
|
|
3
|
+
/**
|
|
4
|
+
* A comment enriched with its author's display name (when the API
|
|
5
|
+
* includes the user record).
|
|
6
|
+
*/
|
|
7
|
+
export interface CommentWithAuthor extends Comment {
|
|
8
|
+
authorName?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Add a comment to a card.
|
|
12
|
+
*/
|
|
13
|
+
export declare function createComment(input: CreateCommentInput): Promise<Comment>;
|
|
14
|
+
/**
|
|
15
|
+
* Update a comment's text.
|
|
16
|
+
*/
|
|
17
|
+
export declare function updateComment(input: UpdateCommentParamsInput): Promise<Comment>;
|
|
18
|
+
/**
|
|
19
|
+
* Delete a comment.
|
|
20
|
+
*/
|
|
21
|
+
export declare function deleteComment(input: CommentIdInput): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Get all comments for a card, newest first.
|
|
24
|
+
* PLANKA 2.x serves comments only from the dedicated endpoint — the card
|
|
25
|
+
* response's `included` never carries them.
|
|
26
|
+
*/
|
|
27
|
+
export declare function getCommentsForCard(input: CardIdInput): Promise<CommentWithAuthor[]>;
|
|
28
|
+
//# sourceMappingURL=comments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comments.d.ts","sourceRoot":"","sources":["../../src/operations/comments.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAEL,WAAW,EAEX,cAAc,EAEd,kBAAkB,EAElB,wBAAwB,EACzB,MAAM,wBAAwB,CAAC;AAGhC;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,OAAO;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,CAY/E;AAED;;GAEG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,wBAAwB,GAC9B,OAAO,CAAC,OAAO,CAAC,CAUlB;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAGxE;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,WAAW,GACjB,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAmB9B"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Comment operations for PLANKA API.
|
|
3
|
+
*/
|
|
4
|
+
import { plankaClient } from "../client.js";
|
|
5
|
+
import { parseInput } from "../errors.js";
|
|
6
|
+
import { CardIdSchema, CommentIdSchema, CreateCommentSchema, UpdateCommentParamsSchema, } from "../schemas/requests.js";
|
|
7
|
+
import { CommentResponse, CommentsResponse, CommentsIncludedSchema } from "../schemas/responses.js";
|
|
8
|
+
/**
|
|
9
|
+
* Add a comment to a card.
|
|
10
|
+
*/
|
|
11
|
+
export async function createComment(input) {
|
|
12
|
+
const validated = parseInput(CreateCommentSchema, input);
|
|
13
|
+
const response = await plankaClient.post(`/api/cards/${validated.cardId}/comments`, {
|
|
14
|
+
text: validated.text,
|
|
15
|
+
});
|
|
16
|
+
const parsed = CommentResponse.parse(response);
|
|
17
|
+
return parsed.item;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Update a comment's text.
|
|
21
|
+
*/
|
|
22
|
+
export async function updateComment(input) {
|
|
23
|
+
const { commentId, ...updates } = parseInput(UpdateCommentParamsSchema, input);
|
|
24
|
+
const response = await plankaClient.patch(`/api/comments/${commentId}`, updates);
|
|
25
|
+
const parsed = CommentResponse.parse(response);
|
|
26
|
+
return parsed.item;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Delete a comment.
|
|
30
|
+
*/
|
|
31
|
+
export async function deleteComment(input) {
|
|
32
|
+
const { commentId } = parseInput(CommentIdSchema, input);
|
|
33
|
+
await plankaClient.delete(`/api/comments/${commentId}`);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Get all comments for a card, newest first.
|
|
37
|
+
* PLANKA 2.x serves comments only from the dedicated endpoint — the card
|
|
38
|
+
* response's `included` never carries them.
|
|
39
|
+
*/
|
|
40
|
+
export async function getCommentsForCard(input) {
|
|
41
|
+
const { cardId } = parseInput(CardIdSchema, input);
|
|
42
|
+
const response = await plankaClient.get(`/api/cards/${cardId}/comments`);
|
|
43
|
+
const parsed = CommentsResponse.parse(response);
|
|
44
|
+
const included = CommentsIncludedSchema.parse(response.included || {});
|
|
45
|
+
const users = included.users || [];
|
|
46
|
+
return parsed.items
|
|
47
|
+
.map((c) => ({
|
|
48
|
+
...c,
|
|
49
|
+
authorName: users.find((u) => u.id === c.userId)?.name,
|
|
50
|
+
}))
|
|
51
|
+
.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=comments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comments.js","sourceRoot":"","sources":["../../src/operations/comments.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EACL,YAAY,EAEZ,eAAe,EAEf,mBAAmB,EAEnB,yBAAyB,GAE1B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAUpG;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,KAAyB;IAC3D,MAAM,SAAS,GAAG,UAAU,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;IAEzD,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,IAAI,CACtC,cAAc,SAAS,CAAC,MAAM,WAAW,EACzC;QACE,IAAI,EAAE,SAAS,CAAC,IAAI;KACrB,CACF,CAAC;IAEF,MAAM,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC/C,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,KAA+B;IAE/B,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,EAAE,GAAG,UAAU,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;IAE/E,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,KAAK,CACvC,iBAAiB,SAAS,EAAE,EAC5B,OAAO,CACR,CAAC;IAEF,MAAM,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC/C,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC;AAED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ateLabelInput, LabelIdInput, RemoveLabelFromCardInput, SetCardLabelsInput, UpdateLabelParamsInput } from "../schemas/requests.js";
|
|
3
|
+
/**
|
|
4
|
+
* Create a new label on a board.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createLabel(input: CreateLabelInput): Promise<Label>;
|
|
7
|
+
/**
|
|
8
|
+
* Update a label's properties.
|
|
9
|
+
*/
|
|
10
|
+
export declare function updateLabel(input: UpdateLabelParamsInput): Promise<Label>;
|
|
11
|
+
/**
|
|
12
|
+
* Delete a label.
|
|
13
|
+
*/
|
|
14
|
+
export declare function deleteLabel(input: LabelIdInput): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Add a label to a card.
|
|
17
|
+
* Uses PLANKA 2.0 /card-labels endpoint.
|
|
18
|
+
*/
|
|
19
|
+
export declare function addLabelToCard(input: AddLabelToCardInput): Promise<CardLabel>;
|
|
20
|
+
/**
|
|
21
|
+
* Remove a label from a card.
|
|
22
|
+
* Uses PLANKA 2.0 /card-labels endpoint.
|
|
23
|
+
*
|
|
24
|
+
* The path segment is PLANKA's criteria syntax — `labelId:<id>`, NOT the
|
|
25
|
+
* junction record's own id. Deleting by cardLabelId answers 404 on 2.x and the
|
|
26
|
+
* label silently stays on the card. Verified against PLANKA 2.x on 2026-08-02.
|
|
27
|
+
*/
|
|
28
|
+
export declare function removeLabelFromCard(input: RemoveLabelFromCardInput): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Outcome of setCardLabels, verified against the card's real state.
|
|
31
|
+
*
|
|
32
|
+
* Reporting the requested counts is not good enough: if a labelId does not
|
|
33
|
+
* exist on the board, PLANKA answers 404 and the label silently never lands.
|
|
34
|
+
* Callers need to know what is actually on the card, not what was asked for.
|
|
35
|
+
*/
|
|
36
|
+
export interface SetCardLabelsResult {
|
|
37
|
+
/** Labels this call put on the card. */
|
|
38
|
+
added: string[];
|
|
39
|
+
/** Labels asked for that were already there. */
|
|
40
|
+
alreadyPresent: string[];
|
|
41
|
+
/** Labels this call took off the card. */
|
|
42
|
+
removed: string[];
|
|
43
|
+
/** Labels asked to be removed that were not on the card. */
|
|
44
|
+
notPresent: string[];
|
|
45
|
+
/** Labels asked for that are still NOT on the card — these are failures. */
|
|
46
|
+
failed: Array<{
|
|
47
|
+
labelId: string;
|
|
48
|
+
reason: string;
|
|
49
|
+
}>;
|
|
50
|
+
/** Every label on the card once the operation finished. */
|
|
51
|
+
finalLabelIds: string[];
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Set labels on a card (add some, remove others).
|
|
55
|
+
*
|
|
56
|
+
* Re-reads the card afterwards so the result reflects reality rather than the
|
|
57
|
+
* request. Never reports success for a label that did not land.
|
|
58
|
+
*/
|
|
59
|
+
export declare function setCardLabels(input: SetCardLabelsInput): Promise<SetCardLabelsResult>;
|
|
60
|
+
//# sourceMappingURL=labels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../../src/operations/labels.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAEL,mBAAmB,EAEnB,gBAAgB,EAEhB,YAAY,EAEZ,wBAAwB,EAExB,kBAAkB,EAElB,sBAAsB,EACvB,MAAM,wBAAwB,CAAC;AAIhC;;GAEG;AACH,wBAAsB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,KAAK,CAAC,CAgBzE;AAED;;GAEG;AACH,wBAAsB,WAAW,CAC/B,KAAK,EAAE,sBAAsB,GAC5B,OAAO,CAAC,KAAK,CAAC,CAUhB;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAGpE;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,SAAS,CAAC,CAYnF;AAED;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,wBAAwB,GAC9B,OAAO,CAAC,IAAI,CAAC,CAKf;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC,wCAAwC;IACxC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,gDAAgD;IAChD,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,0CAA0C;IAC1C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,4DAA4D;IAC5D,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,4EAA4E;IAC5E,MAAM,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnD,2DAA2D;IAC3D,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,mBAAmB,CAAC,CAwF9B"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Label operations for PLANKA API.
|
|
3
|
+
*/
|
|
4
|
+
import { plankaClient } from "../client.js";
|
|
5
|
+
import { withBoardId } from "./board-id.js";
|
|
6
|
+
import { parseInput } from "../errors.js";
|
|
7
|
+
import { AddLabelToCardSchema, CreateLabelSchema, LabelIdSchema, RemoveLabelFromCardSchema, SetCardLabelsSchema, UpdateLabelParamsSchema, } from "../schemas/requests.js";
|
|
8
|
+
import { LabelResponse, CardLabelResponse } from "../schemas/responses.js";
|
|
9
|
+
import { getCard } from "./cards.js";
|
|
10
|
+
/**
|
|
11
|
+
* Create a new label on a board.
|
|
12
|
+
*/
|
|
13
|
+
export async function createLabel(input) {
|
|
14
|
+
const validated = parseInput(CreateLabelSchema, input);
|
|
15
|
+
return withBoardId(validated.boardId, async (boardId) => {
|
|
16
|
+
const response = await plankaClient.post(`/api/boards/${boardId}/labels`, {
|
|
17
|
+
name: validated.name,
|
|
18
|
+
color: validated.color,
|
|
19
|
+
position: validated.position,
|
|
20
|
+
});
|
|
21
|
+
const parsed = LabelResponse.parse(response);
|
|
22
|
+
return parsed.item;
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Update a label's properties.
|
|
27
|
+
*/
|
|
28
|
+
export async function updateLabel(input) {
|
|
29
|
+
const { labelId, ...updates } = parseInput(UpdateLabelParamsSchema, input);
|
|
30
|
+
const response = await plankaClient.patch(`/api/labels/${labelId}`, updates);
|
|
31
|
+
const parsed = LabelResponse.parse(response);
|
|
32
|
+
return parsed.item;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Delete a label.
|
|
36
|
+
*/
|
|
37
|
+
export async function deleteLabel(input) {
|
|
38
|
+
const { labelId } = parseInput(LabelIdSchema, input);
|
|
39
|
+
await plankaClient.delete(`/api/labels/${labelId}`);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Add a label to a card.
|
|
43
|
+
* Uses PLANKA 2.0 /card-labels endpoint.
|
|
44
|
+
*/
|
|
45
|
+
export async function addLabelToCard(input) {
|
|
46
|
+
const validated = parseInput(AddLabelToCardSchema, input);
|
|
47
|
+
const response = await plankaClient.post(`/api/cards/${validated.cardId}/card-labels`, {
|
|
48
|
+
labelId: validated.labelId,
|
|
49
|
+
});
|
|
50
|
+
const parsed = CardLabelResponse.parse(response);
|
|
51
|
+
return parsed.item;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Remove a label from a card.
|
|
55
|
+
* Uses PLANKA 2.0 /card-labels endpoint.
|
|
56
|
+
*
|
|
57
|
+
* The path segment is PLANKA's criteria syntax — `labelId:<id>`, NOT the
|
|
58
|
+
* junction record's own id. Deleting by cardLabelId answers 404 on 2.x and the
|
|
59
|
+
* label silently stays on the card. Verified against PLANKA 2.x on 2026-08-02.
|
|
60
|
+
*/
|
|
61
|
+
export async function removeLabelFromCard(input) {
|
|
62
|
+
const { cardId, labelId } = parseInput(RemoveLabelFromCardSchema, input);
|
|
63
|
+
await plankaClient.delete(`/api/cards/${cardId}/card-labels/labelId:${labelId}`);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Set labels on a card (add some, remove others).
|
|
67
|
+
*
|
|
68
|
+
* Re-reads the card afterwards so the result reflects reality rather than the
|
|
69
|
+
* request. Never reports success for a label that did not land.
|
|
70
|
+
*/
|
|
71
|
+
export async function setCardLabels(input) {
|
|
72
|
+
const { cardId, addLabelIds, removeLabelIds } = parseInput(SetCardLabelsSchema, input);
|
|
73
|
+
const toAdd = addLabelIds ?? [];
|
|
74
|
+
const toRemove = removeLabelIds ?? [];
|
|
75
|
+
const before = await getCard({ cardId });
|
|
76
|
+
const presentBefore = new Set(before.cardLabels.map((cl) => cl.labelId));
|
|
77
|
+
const result = {
|
|
78
|
+
added: [],
|
|
79
|
+
alreadyPresent: [],
|
|
80
|
+
removed: [],
|
|
81
|
+
notPresent: [],
|
|
82
|
+
failed: [],
|
|
83
|
+
finalLabelIds: [],
|
|
84
|
+
};
|
|
85
|
+
// Remove first, so a caller can swap a label for another in one call.
|
|
86
|
+
for (const labelId of toRemove) {
|
|
87
|
+
if (!presentBefore.has(labelId)) {
|
|
88
|
+
result.notPresent.push(labelId);
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
try {
|
|
92
|
+
await removeLabelFromCard({ cardId, labelId });
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
result.failed.push({
|
|
96
|
+
labelId,
|
|
97
|
+
reason: error instanceof Error ? error.message : String(error),
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
for (const labelId of toAdd) {
|
|
102
|
+
if (presentBefore.has(labelId)) {
|
|
103
|
+
result.alreadyPresent.push(labelId);
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
try {
|
|
107
|
+
await addLabelToCard({ cardId, labelId });
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
111
|
+
// "already on card" is not a failure — the desired state holds.
|
|
112
|
+
if (message.toLowerCase().includes("already")) {
|
|
113
|
+
result.alreadyPresent.push(labelId);
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
result.failed.push({ labelId, reason: message });
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// Verify against the card itself: this is what makes the report trustworthy.
|
|
120
|
+
const after = await getCard({ cardId });
|
|
121
|
+
const presentAfter = new Set(after.cardLabels.map((cl) => cl.labelId));
|
|
122
|
+
result.finalLabelIds = [...presentAfter];
|
|
123
|
+
result.added = toAdd.filter((id) => presentAfter.has(id) && !presentBefore.has(id));
|
|
124
|
+
result.removed = toRemove.filter((id) => presentBefore.has(id) && !presentAfter.has(id));
|
|
125
|
+
// Anything requested that is still missing (or still there) is a failure,
|
|
126
|
+
// even if the HTTP call did not throw.
|
|
127
|
+
const known = new Set(result.failed.map((f) => f.labelId));
|
|
128
|
+
for (const id of toAdd) {
|
|
129
|
+
if (!presentAfter.has(id) && !known.has(id)) {
|
|
130
|
+
result.failed.push({
|
|
131
|
+
labelId: id,
|
|
132
|
+
reason: "the label is still not on the card — check that this labelId belongs to the card's board",
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
for (const id of toRemove) {
|
|
137
|
+
if (presentAfter.has(id) && !known.has(id)) {
|
|
138
|
+
result.failed.push({
|
|
139
|
+
labelId: id,
|
|
140
|
+
reason: "the label is still on the card",
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return result;
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=labels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labels.js","sourceRoot":"","sources":["../../src/operations/labels.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAA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C3D,KAAK,MAAM,EAAE,IAAI,KAAK,EAAE,CAAC;QACvB,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;YAC5C,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;gBACjB,OAAO,EAAE,EAAE;gBACX,MAAM,EACJ,0FAA0F;aAC7F,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,KAAK,MAAM,EAAE,IAAI,QAAQ,EAAE,CAAC;QAC1B,IAAI,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;YAC3C,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;gBACjB,OAAO,EAAE,EAAE;gBACX,MAAM,EAAE,gCAAgC;aACzC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { List } from "../schemas/entities.js";
|
|
2
|
+
import { CreateListInput, ListIdInput, UpdateListParamsInput } from "../schemas/requests.js";
|
|
3
|
+
/**
|
|
4
|
+
* Create a new list on a board.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createList(input: CreateListInput): Promise<List>;
|
|
7
|
+
/**
|
|
8
|
+
* Update a list's properties.
|
|
9
|
+
*/
|
|
10
|
+
export declare function updateList(input: UpdateListParamsInput): Promise<List>;
|
|
11
|
+
/**
|
|
12
|
+
* Delete a list.
|
|
13
|
+
*/
|
|
14
|
+
export declare function deleteList(input: ListIdInput): Promise<void>;
|
|
15
|
+
//# sourceMappingURL=lists.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lists.d.ts","sourceRoot":"","sources":["../../src/operations/lists.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE9C,OAAO,EAEL,eAAe,EAEf,WAAW,EAEX,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AAEhC;;GAEG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBtE;AAED;;GAEG;AACH,wBAAsB,UAAU,CAC9B,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,IAAI,CAAC,CAUf;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAGlE"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* List operations for PLANKA API.
|
|
3
|
+
*/
|
|
4
|
+
import { plankaClient } from "../client.js";
|
|
5
|
+
import { withBoardId } from "./board-id.js";
|
|
6
|
+
import { parseInput } from "../errors.js";
|
|
7
|
+
import { ListResponse } from "../schemas/responses.js";
|
|
8
|
+
import { CreateListSchema, ListIdSchema, UpdateListParamsSchema, } from "../schemas/requests.js";
|
|
9
|
+
/**
|
|
10
|
+
* Create a new list on a board.
|
|
11
|
+
*/
|
|
12
|
+
export async function createList(input) {
|
|
13
|
+
const validated = parseInput(CreateListSchema, input);
|
|
14
|
+
return withBoardId(validated.boardId, async (boardId) => {
|
|
15
|
+
const response = await plankaClient.post(`/api/boards/${boardId}/lists`, {
|
|
16
|
+
name: validated.name,
|
|
17
|
+
position: validated.position,
|
|
18
|
+
type: validated.type, // Required by PLANKA 2.0; defaults to "active"
|
|
19
|
+
});
|
|
20
|
+
const parsed = ListResponse.parse(response);
|
|
21
|
+
return parsed.item;
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Update a list's properties.
|
|
26
|
+
*/
|
|
27
|
+
export async function updateList(input) {
|
|
28
|
+
const { listId, ...updates } = parseInput(UpdateListParamsSchema, input);
|
|
29
|
+
const response = await plankaClient.patch(`/api/lists/${listId}`, updates);
|
|
30
|
+
const parsed = ListResponse.parse(response);
|
|
31
|
+
return parsed.item;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Delete a list.
|
|
35
|
+
*/
|
|
36
|
+
export async function deleteList(input) {
|
|
37
|
+
const { listId } = parseInput(ListIdSchema, input);
|
|
38
|
+
await plankaClient.delete(`/api/lists/${listId}`);
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=lists.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lists.js","sourceRoot":"","sources":["../../src/operations/lists.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EACL,gBAAgB,EAEhB,YAAY,EAEZ,sBAAsB,GAEvB,MAAM,wBAAwB,CAAC;AAEhC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,KAAsB;IACrD,MAAM,SAAS,GAAG,UAAU,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;IAEtD,OAAO,WAAW,CAAC,SAAS,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QACtD,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,IAAI,CACtC,eAAe,OAAO,QAAQ,EAC9B;YACE,IAAI,EAAE,SAAS,CAAC,IAAI;YACpB,QAAQ,EAAE,SAAS,CAAC,QAAQ;YAC5B,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,+CAA+C;SACtE,CACF,CAAC;QAEF,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC5C,OAAO,MAAM,CAAC,IAAI,CAAC;IACrB,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,KAA4B;IAE5B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,GAAG,UAAU,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;IAEzE,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,KAAK,CACvC,cAAc,MAAM,EAAE,EACtB,OAAO,CACR,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,KAAkB;IACjD,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IACnD,MAAM,YAAY,CAAC,MAAM,CAAC,cAAc,MAAM,EAAE,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Project, Board, List } from "../schemas/entities.js";
|
|
2
|
+
import { GetStructureInput } from "../schemas/requests.js";
|
|
3
|
+
/**
|
|
4
|
+
* Full project structure with boards and lists.
|
|
5
|
+
*/
|
|
6
|
+
export interface ProjectStructure {
|
|
7
|
+
project: Project;
|
|
8
|
+
boards: Array<{
|
|
9
|
+
board: Board;
|
|
10
|
+
lists: List[];
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Get all projects with their boards.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getProjects(): Promise<{
|
|
17
|
+
projects: Project[];
|
|
18
|
+
boards: Board[];
|
|
19
|
+
}>;
|
|
20
|
+
/**
|
|
21
|
+
* Get the full structure: projects -> boards -> lists.
|
|
22
|
+
*/
|
|
23
|
+
export declare function getStructure(input?: GetStructureInput): Promise<ProjectStructure[]>;
|
|
24
|
+
//# sourceMappingURL=projects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/operations/projects.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAsB,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAG/E;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,KAAK,CAAC;QACZ,KAAK,EAAE,KAAK,CAAC;QACb,KAAK,EAAE,IAAI,EAAE,CAAC;KACf,CAAC,CAAC;CACJ;AAED;;GAEG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC;IAC3C,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB,CAAC,CAWD;AAED;;GAEG;AACH,wBAAsB,YAAY,CAChC,KAAK,GAAE,iBAAsB,GAC5B,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAkD7B"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project operations for PLANKA API.
|
|
3
|
+
*/
|
|
4
|
+
import { plankaClient } from "../client.js";
|
|
5
|
+
import { parseInput } from "../errors.js";
|
|
6
|
+
import { ProjectsResponse, ProjectsIncludedSchema } from "../schemas/responses.js";
|
|
7
|
+
import { GetStructureSchema } from "../schemas/requests.js";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
/**
|
|
10
|
+
* Get all projects with their boards.
|
|
11
|
+
*/
|
|
12
|
+
export async function getProjects() {
|
|
13
|
+
const response = await plankaClient.get("/api/projects");
|
|
14
|
+
const parsed = ProjectsResponse.parse(response);
|
|
15
|
+
const included = ProjectsIncludedSchema.parse(response.included || {});
|
|
16
|
+
return {
|
|
17
|
+
projects: parsed.items,
|
|
18
|
+
boards: included.boards || [],
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get the full structure: projects -> boards -> lists.
|
|
23
|
+
*/
|
|
24
|
+
export async function getStructure(input = {}) {
|
|
25
|
+
const { projectId } = parseInput(GetStructureSchema, input);
|
|
26
|
+
const { projects, boards } = await getProjects();
|
|
27
|
+
// Filter to specific project if requested
|
|
28
|
+
const targetProjects = projectId
|
|
29
|
+
? projects.filter((p) => p.id === projectId)
|
|
30
|
+
: projects;
|
|
31
|
+
const structures = [];
|
|
32
|
+
for (const project of targetProjects) {
|
|
33
|
+
const projectBoards = boards.filter((b) => b.projectId === project.id);
|
|
34
|
+
const boardsWithLists = [];
|
|
35
|
+
for (const board of projectBoards) {
|
|
36
|
+
// Get board details to get lists
|
|
37
|
+
const boardResponse = await plankaClient.get(`/api/boards/${board.id}`);
|
|
38
|
+
const included = boardResponse.included;
|
|
39
|
+
const lists = included?.lists
|
|
40
|
+
? z.array(z.object({
|
|
41
|
+
id: z.string(),
|
|
42
|
+
boardId: z.string(),
|
|
43
|
+
name: z.string().nullable(),
|
|
44
|
+
position: z.number().nullable(),
|
|
45
|
+
createdAt: z.string(),
|
|
46
|
+
updatedAt: z.string().nullable().optional(),
|
|
47
|
+
})).parse(included.lists)
|
|
48
|
+
: [];
|
|
49
|
+
boardsWithLists.push({
|
|
50
|
+
board,
|
|
51
|
+
lists: lists.sort((a, b) => (a.position ?? 0) - (b.position ?? 0)),
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
structures.push({
|
|
55
|
+
project,
|
|
56
|
+
boards: boardsWithLists.sort((a, b) => a.board.position - b.board.position),
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return structures;
|
|
60
|
+
}
|
|
61
|
+
//# 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,EAAE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C,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 { BatchCreateTasksInput, CreateTaskListInput, CreateTaskInput, TaskIdInput, TaskListIdInput, UpdateTaskParamsInput } from "../schemas/requests.js";
|
|
3
|
+
/**
|
|
4
|
+
* Create a task-list on a card.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createTaskList(input: CreateTaskListInput): 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(input: UpdateTaskParamsInput): Promise<Task>;
|
|
22
|
+
/**
|
|
23
|
+
* Delete a task.
|
|
24
|
+
*/
|
|
25
|
+
export declare function deleteTask(input: TaskIdInput): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Delete a task-list and all its tasks.
|
|
28
|
+
*/
|
|
29
|
+
export declare function deleteTaskList(input: TaskListIdInput): 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":"AASA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAEL,qBAAqB,EAGrB,mBAAmB,EAEnB,eAAe,EAEf,WAAW,EAEX,eAAe,EAEf,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AAqChC;;GAEG;AACH,wBAAsB,cAAc,CAClC,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,QAAQ,CAAC,CAanB;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAkBtE;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CA0B/E;AAED;;GAEG;AACH,wBAAsB,UAAU,CAC9B,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,IAAI,CAAC,CAUf;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAGlE;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAG1E"}
|