backlog-mcp-server 0.17.0 → 0.18.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/README.ja.md +15 -32
- package/README.md +20 -32
- package/build/auth/oauthRoutes.js +53 -1
- package/build/createBacklogMcpServer.d.ts +4 -6
- package/build/createBacklogMcpServer.js +4 -12
- package/build/handlers/builders/composeToolHandler.d.ts +1 -1
- package/build/handlers/builders/composeToolHandler.js +15 -9
- package/build/handlers/transformers/wrapWithFieldPicking.d.ts +14 -1
- package/build/handlers/transformers/wrapWithFieldPicking.js +30 -36
- package/build/index.js +20 -15
- package/build/lib.d.ts +1 -1
- package/build/reportUnknownOverrideKeys.js +0 -1
- package/build/tools/addDocument.d.ts +2 -2
- package/build/tools/addDocument.js +17 -2
- package/build/tools/addIssue.d.ts +2 -2
- package/build/tools/addIssue.js +32 -2
- package/build/tools/addIssueComment.d.ts +2 -2
- package/build/tools/addIssueComment.js +14 -2
- package/build/tools/addProject.d.ts +2 -2
- package/build/tools/addProject.js +22 -2
- package/build/tools/addPullRequest.d.ts +2 -2
- package/build/tools/addPullRequest.js +26 -2
- package/build/tools/addPullRequestComment.d.ts +2 -2
- package/build/tools/addPullRequestComment.js +12 -2
- package/build/tools/addRelatedIssue.d.ts +2 -2
- package/build/tools/addRelatedIssue.js +33 -2
- package/build/tools/addVersionMilestone.d.ts +2 -2
- package/build/tools/addVersionMilestone.js +12 -2
- package/build/tools/addWatching.d.ts +2 -2
- package/build/tools/addWatching.js +12 -2
- package/build/tools/addWiki.d.ts +2 -2
- package/build/tools/addWiki.js +16 -2
- package/build/tools/countIssues.d.ts +2 -2
- package/build/tools/countIssues.js +3 -2
- package/build/tools/deleteIssue.d.ts +2 -2
- package/build/tools/deleteIssue.js +32 -2
- package/build/tools/deleteProject.d.ts +2 -2
- package/build/tools/deleteProject.js +22 -2
- package/build/tools/deleteVersion.d.ts +2 -2
- package/build/tools/deleteVersion.js +12 -2
- package/build/tools/deleteWatching.d.ts +2 -2
- package/build/tools/deleteWatching.js +12 -2
- package/build/tools/getCategories.d.ts +2 -2
- package/build/tools/getCategories.js +8 -2
- package/build/tools/getCustomFields.d.ts +2 -2
- package/build/tools/getCustomFields.js +22 -2
- package/build/tools/getDocument.d.ts +2 -2
- package/build/tools/getDocument.js +17 -2
- package/build/tools/getDocumentTree.d.ts +2 -2
- package/build/tools/getDocumentTree.js +7 -2
- package/build/tools/getDocuments.d.ts +2 -2
- package/build/tools/getDocuments.js +17 -2
- package/build/tools/getGitRepositories.d.ts +2 -2
- package/build/tools/getGitRepositories.js +17 -2
- package/build/tools/getGitRepository.d.ts +2 -2
- package/build/tools/getGitRepository.js +17 -2
- package/build/tools/getIssue.d.ts +2 -2
- package/build/tools/getIssue.js +32 -2
- package/build/tools/getIssueComments.d.ts +2 -2
- package/build/tools/getIssueComments.js +14 -2
- package/build/tools/getIssueTypes.d.ts +2 -2
- package/build/tools/getIssueTypes.js +11 -2
- package/build/tools/getIssues.d.ts +10 -10
- package/build/tools/getIssues.js +32 -2
- package/build/tools/getMyself.d.ts +2 -2
- package/build/tools/getMyself.js +11 -2
- package/build/tools/getNotifications.d.ts +2 -2
- package/build/tools/getNotifications.js +15 -2
- package/build/tools/getNotificationsCount.d.ts +2 -2
- package/build/tools/getNotificationsCount.js +5 -2
- package/build/tools/getPriorities.d.ts +2 -2
- package/build/tools/getPriorities.js +3 -2
- package/build/tools/getProject.d.ts +2 -2
- package/build/tools/getProject.js +22 -2
- package/build/tools/getProjectList.d.ts +2 -2
- package/build/tools/getProjectList.js +22 -2
- package/build/tools/getProjectUsers.d.ts +2 -2
- package/build/tools/getProjectUsers.js +11 -2
- package/build/tools/getPullRequest.d.ts +2 -2
- package/build/tools/getPullRequest.js +26 -2
- package/build/tools/getPullRequestComments.d.ts +2 -2
- package/build/tools/getPullRequestComments.js +12 -2
- package/build/tools/getPullRequests.d.ts +2 -2
- package/build/tools/getPullRequests.js +26 -2
- package/build/tools/getPullRequestsCount.d.ts +2 -2
- package/build/tools/getPullRequestsCount.js +5 -2
- package/build/tools/getRelatedIssues.d.ts +2 -2
- package/build/tools/getRelatedIssues.js +33 -2
- package/build/tools/getResolutions.d.ts +2 -2
- package/build/tools/getResolutions.js +3 -2
- package/build/tools/getSpace.d.ts +2 -2
- package/build/tools/getSpace.js +13 -2
- package/build/tools/getSpaceActivities.d.ts +2 -2
- package/build/tools/getSpaceActivities.js +12 -2
- package/build/tools/getUserRecentUpdates.d.ts +2 -2
- package/build/tools/getUserRecentUpdates.js +12 -2
- package/build/tools/getUserStarsCount.d.ts +2 -2
- package/build/tools/getUserStarsCount.js +3 -2
- package/build/tools/getUsers.d.ts +2 -2
- package/build/tools/getUsers.js +11 -2
- package/build/tools/getVersionMilestoneList.d.ts +2 -2
- package/build/tools/getVersionMilestoneList.js +12 -2
- package/build/tools/getWatchingListCount.d.ts +2 -2
- package/build/tools/getWatchingListCount.js +5 -2
- package/build/tools/getWatchingListItems.d.ts +2 -2
- package/build/tools/getWatchingListItems.js +12 -2
- package/build/tools/getWiki.d.ts +2 -2
- package/build/tools/getWiki.js +16 -2
- package/build/tools/getWikiPages.d.ts +2 -2
- package/build/tools/getWikiPages.js +12 -2
- package/build/tools/getWikisCount.d.ts +2 -2
- package/build/tools/getWikisCount.js +3 -2
- package/build/tools/markNotificationAsRead.d.ts +6 -1
- package/build/tools/markNotificationAsRead.js +6 -1
- package/build/tools/markWatchingAsRead.d.ts +6 -1
- package/build/tools/markWatchingAsRead.js +6 -1
- package/build/tools/removeRelatedIssue.d.ts +2 -2
- package/build/tools/removeRelatedIssue.js +33 -2
- package/build/tools/resetUnreadNotificationCount.d.ts +2 -2
- package/build/tools/resetUnreadNotificationCount.js +5 -2
- package/build/tools/updateIssue.d.ts +2 -2
- package/build/tools/updateIssue.js +32 -2
- package/build/tools/updateIssueComment.d.ts +2 -2
- package/build/tools/updateIssueComment.js +14 -2
- package/build/tools/updateProject.d.ts +2 -2
- package/build/tools/updateProject.js +22 -2
- package/build/tools/updatePullRequest.d.ts +2 -2
- package/build/tools/updatePullRequest.js +26 -2
- package/build/tools/updatePullRequestComment.d.ts +2 -2
- package/build/tools/updatePullRequestComment.js +12 -2
- package/build/tools/updateVersionMilestone.d.ts +2 -2
- package/build/tools/updateVersionMilestone.js +12 -2
- package/build/tools/updateWatching.d.ts +2 -2
- package/build/tools/updateWatching.js +12 -2
- package/build/tools/updateWiki.d.ts +2 -2
- package/build/tools/updateWiki.js +16 -2
- package/build/types/outputFields.d.ts +26 -0
- package/build/types/outputFields.js +3 -0
- package/build/types/tool.d.ts +21 -8
- package/build/types/zod/activityType.d.ts +38 -0
- package/build/types/zod/activityType.js +38 -0
- package/build/utils/fieldSelection.d.ts +22 -0
- package/build/utils/fieldSelection.js +40 -0
- package/build/utils/toolsetUtils.d.ts +1 -3
- package/build/utils/toolsetUtils.js +0 -12
- package/package.json +1 -2
- package/build/tools/dynamicTools/toolsets.d.ts +0 -15
- package/build/tools/dynamicTools/toolsets.js +0 -103
- package/build/types/zod/backlogOutputDefinition.d.ts +0 -3334
- package/build/types/zod/backlogOutputDefinition.js +0 -483
- package/build/utils/generateFieldsDescription.d.ts +0 -5
- package/build/utils/generateFieldsDescription.js +0 -50
- package/build/utils/toolRegistrar.d.ts +0 -5
- package/build/utils/toolRegistrar.js +0 -12
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { DocumentItemSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
3
2
|
import { buildToolSchema } from '../types/tool.js';
|
|
3
|
+
import { outputFields } from '../types/outputFields.js';
|
|
4
4
|
const addDocumentSchema = buildToolSchema((t) => ({
|
|
5
5
|
projectId: z
|
|
6
6
|
.number()
|
|
@@ -31,7 +31,22 @@ export const addDocumentTool = (backlog, { t }) => {
|
|
|
31
31
|
name: 'addDocument',
|
|
32
32
|
description: t('TOOL_ADD_DOCUMENT_DESCRIPTION', 'Adds a new document to the specified project.'),
|
|
33
33
|
schema: z.object(addDocumentSchema(t)),
|
|
34
|
-
|
|
34
|
+
returnsList: false,
|
|
35
|
+
outputFields: outputFields()([
|
|
36
|
+
'id',
|
|
37
|
+
'projectId',
|
|
38
|
+
'title',
|
|
39
|
+
'plain',
|
|
40
|
+
'json',
|
|
41
|
+
'statusId',
|
|
42
|
+
'emoji',
|
|
43
|
+
'attachments',
|
|
44
|
+
'tags',
|
|
45
|
+
'createdUser',
|
|
46
|
+
'created',
|
|
47
|
+
'updatedUser',
|
|
48
|
+
'updated',
|
|
49
|
+
]),
|
|
35
50
|
importantFields: ['id', 'projectId', 'title', 'plain', 'createdUser'],
|
|
36
51
|
handler: async (params) => {
|
|
37
52
|
return backlog.addDocument(params);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { Entity } from 'backlog-js';
|
|
1
2
|
import { Backlog } from 'backlog-js';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
4
|
-
import { IssueSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
5
5
|
import { ToolDefinition } from '../types/tool.js';
|
|
6
6
|
declare const addIssueSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
projectId: z.ZodNumber;
|
|
@@ -26,5 +26,5 @@ declare const addIssueSchema: (t: DescriptionHelper["t"]) => {
|
|
|
26
26
|
otherValue: z.ZodOptional<z.ZodString>;
|
|
27
27
|
}, z.core.$strip>>>;
|
|
28
28
|
};
|
|
29
|
-
export declare const addIssueTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addIssueSchema>,
|
|
29
|
+
export declare const addIssueTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addIssueSchema>, Entity.Issue.Issue>;
|
|
30
30
|
export {};
|
package/build/tools/addIssue.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { IssueSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
3
2
|
import { buildToolSchema } from '../types/tool.js';
|
|
3
|
+
import { outputFields } from '../types/outputFields.js';
|
|
4
4
|
import { customFieldsToPayload } from '../backlog/customFields.js';
|
|
5
5
|
const addIssueSchema = buildToolSchema((t) => ({
|
|
6
6
|
projectId: z.number().describe(t('TOOL_ADD_ISSUE_PROJECT_ID', 'Project ID')),
|
|
@@ -88,7 +88,37 @@ export const addIssueTool = (backlog, { t }) => {
|
|
|
88
88
|
name: 'add_issue',
|
|
89
89
|
description: t('TOOL_ADD_ISSUE_DESCRIPTION', 'Creates a new issue in the specified project.'),
|
|
90
90
|
schema: z.object(addIssueSchema(t)),
|
|
91
|
-
|
|
91
|
+
returnsList: false,
|
|
92
|
+
outputFields: outputFields()([
|
|
93
|
+
'id',
|
|
94
|
+
'projectId',
|
|
95
|
+
'issueKey',
|
|
96
|
+
'keyId',
|
|
97
|
+
'issueType',
|
|
98
|
+
'summary',
|
|
99
|
+
'description',
|
|
100
|
+
'resolution',
|
|
101
|
+
'priority',
|
|
102
|
+
'status',
|
|
103
|
+
'assignee',
|
|
104
|
+
'category',
|
|
105
|
+
'versions',
|
|
106
|
+
'milestone',
|
|
107
|
+
'startDate',
|
|
108
|
+
'dueDate',
|
|
109
|
+
'estimatedHours',
|
|
110
|
+
'actualHours',
|
|
111
|
+
'parentIssueId',
|
|
112
|
+
'createdUser',
|
|
113
|
+
'created',
|
|
114
|
+
'updatedUser',
|
|
115
|
+
'updated',
|
|
116
|
+
'customFields',
|
|
117
|
+
'attachments',
|
|
118
|
+
'sharedFiles',
|
|
119
|
+
'stars',
|
|
120
|
+
'childIssueSummary',
|
|
121
|
+
]),
|
|
92
122
|
importantFields: ['summary', 'issueKey', 'description', 'createdUser'],
|
|
93
123
|
handler: async ({ customFields, ...params }) => {
|
|
94
124
|
const customFieldPayload = customFieldsToPayload(customFields);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { Entity } from 'backlog-js';
|
|
2
3
|
import { Backlog } from 'backlog-js';
|
|
3
4
|
import { ToolDefinition } from '../types/tool.js';
|
|
4
5
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
5
|
-
import { IssueCommentSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const addIssueCommentSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
issueId: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
issueKey: z.ZodOptional<z.ZodString>;
|
|
@@ -10,5 +10,5 @@ declare const addIssueCommentSchema: (t: DescriptionHelper["t"]) => {
|
|
|
10
10
|
notifiedUserId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
11
11
|
attachmentId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
12
12
|
};
|
|
13
|
-
export declare const addIssueCommentTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addIssueCommentSchema>,
|
|
13
|
+
export declare const addIssueCommentTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addIssueCommentSchema>, Entity.Issue.Comment>;
|
|
14
14
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { buildToolSchema } from '../types/tool.js';
|
|
3
|
-
import {
|
|
3
|
+
import { outputFields } from '../types/outputFields.js';
|
|
4
4
|
import { resolveIdOrKey } from '../utils/resolveIdOrKey.js';
|
|
5
5
|
const addIssueCommentSchema = buildToolSchema((t) => ({
|
|
6
6
|
issueId: z
|
|
@@ -28,7 +28,19 @@ export const addIssueCommentTool = (backlog, { t }) => {
|
|
|
28
28
|
name: 'add_issue_comment',
|
|
29
29
|
description: t('TOOL_ADD_ISSUE_COMMENT_DESCRIPTION', 'Adds a comment to an issue'),
|
|
30
30
|
schema: z.object(addIssueCommentSchema(t)),
|
|
31
|
-
|
|
31
|
+
returnsList: false,
|
|
32
|
+
outputFields: outputFields()([
|
|
33
|
+
'id',
|
|
34
|
+
'projectId',
|
|
35
|
+
'issueId',
|
|
36
|
+
'content',
|
|
37
|
+
'changeLog',
|
|
38
|
+
'createdUser',
|
|
39
|
+
'created',
|
|
40
|
+
'updated',
|
|
41
|
+
'stars',
|
|
42
|
+
'notifications',
|
|
43
|
+
]),
|
|
32
44
|
handler: async ({ issueId, issueKey, content, notifiedUserId, attachmentId, }) => {
|
|
33
45
|
const result = resolveIdOrKey('issue', { id: issueId, key: issueKey }, t);
|
|
34
46
|
if (!result.ok) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { Entity } from 'backlog-js';
|
|
2
3
|
import { Backlog } from 'backlog-js';
|
|
3
4
|
import { ToolDefinition } from '../types/tool.js';
|
|
4
5
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
5
|
-
import { ProjectSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const addProjectSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
name: z.ZodString;
|
|
8
8
|
key: z.ZodString;
|
|
@@ -14,5 +14,5 @@ declare const addProjectSchema: (t: DescriptionHelper["t"]) => {
|
|
|
14
14
|
markdown: "markdown";
|
|
15
15
|
}>>;
|
|
16
16
|
};
|
|
17
|
-
export declare const addProjectTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addProjectSchema>,
|
|
17
|
+
export declare const addProjectTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addProjectSchema>, Entity.Project.Project>;
|
|
18
18
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { buildToolSchema } from '../types/tool.js';
|
|
3
|
-
import {
|
|
3
|
+
import { outputFields } from '../types/outputFields.js';
|
|
4
4
|
const addProjectSchema = buildToolSchema((t) => ({
|
|
5
5
|
name: z.string().describe(t('TOOL_ADD_PROJECT_NAME', 'Project name')),
|
|
6
6
|
key: z.string().describe(t('TOOL_ADD_PROJECT_KEY', 'Project key')),
|
|
@@ -26,7 +26,27 @@ export const addProjectTool = (backlog, { t }) => {
|
|
|
26
26
|
name: 'add_project',
|
|
27
27
|
description: t('TOOL_ADD_PROJECT_DESCRIPTION', 'Creates a new project'),
|
|
28
28
|
schema: z.object(addProjectSchema(t)),
|
|
29
|
-
|
|
29
|
+
returnsList: false,
|
|
30
|
+
outputFields: outputFields()([
|
|
31
|
+
'id',
|
|
32
|
+
'projectKey',
|
|
33
|
+
'name',
|
|
34
|
+
'chartEnabled',
|
|
35
|
+
'useResolvedForChart',
|
|
36
|
+
'subtaskingEnabled',
|
|
37
|
+
'projectLeaderCanEditProjectLeader',
|
|
38
|
+
'useWiki',
|
|
39
|
+
'useFileSharing',
|
|
40
|
+
'useWikiTreeView',
|
|
41
|
+
'useOriginalImageSizeAtWiki',
|
|
42
|
+
'useSubversion',
|
|
43
|
+
'useGit',
|
|
44
|
+
'textFormattingRule',
|
|
45
|
+
'archived',
|
|
46
|
+
'displayOrder',
|
|
47
|
+
'useDevAttributes',
|
|
48
|
+
'grandchildIssueEnabled',
|
|
49
|
+
]),
|
|
30
50
|
handler: async ({ name, key, chartEnabled, subtaskingEnabled, projectLeaderCanEditProjectLeader, textFormattingRule, }) => backlog.postProject({
|
|
31
51
|
name,
|
|
32
52
|
key,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { Entity } from 'backlog-js';
|
|
2
3
|
import { Backlog } from 'backlog-js';
|
|
3
4
|
import { ToolDefinition } from '../types/tool.js';
|
|
4
5
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
5
|
-
import { PullRequestSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const addPullRequestSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
projectId: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
projectKey: z.ZodOptional<z.ZodString>;
|
|
@@ -16,5 +16,5 @@ declare const addPullRequestSchema: (t: DescriptionHelper["t"]) => {
|
|
|
16
16
|
assigneeId: z.ZodOptional<z.ZodNumber>;
|
|
17
17
|
notifiedUserId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
18
18
|
};
|
|
19
|
-
export declare const addPullRequestTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addPullRequestSchema>,
|
|
19
|
+
export declare const addPullRequestTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addPullRequestSchema>, Entity.PullRequest.PullRequest>;
|
|
20
20
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { buildToolSchema } from '../types/tool.js';
|
|
3
|
-
import {
|
|
3
|
+
import { outputFields } from '../types/outputFields.js';
|
|
4
4
|
import { resolveIdOrKey, resolveIdOrName } from '../utils/resolveIdOrKey.js';
|
|
5
5
|
const addPullRequestSchema = buildToolSchema((t) => ({
|
|
6
6
|
projectId: z
|
|
@@ -49,7 +49,31 @@ export const addPullRequestTool = (backlog, { t }) => {
|
|
|
49
49
|
name: 'add_pull_request',
|
|
50
50
|
description: t('TOOL_ADD_PULL_REQUEST_DESCRIPTION', 'Creates a new pull request'),
|
|
51
51
|
schema: z.object(addPullRequestSchema(t)),
|
|
52
|
-
|
|
52
|
+
returnsList: false,
|
|
53
|
+
outputFields: outputFields()([
|
|
54
|
+
'id',
|
|
55
|
+
'projectId',
|
|
56
|
+
'repositoryId',
|
|
57
|
+
'number',
|
|
58
|
+
'summary',
|
|
59
|
+
'description',
|
|
60
|
+
'base',
|
|
61
|
+
'branch',
|
|
62
|
+
'status',
|
|
63
|
+
'assignee',
|
|
64
|
+
'issue',
|
|
65
|
+
'baseCommit',
|
|
66
|
+
'branchCommit',
|
|
67
|
+
'mergeCommit',
|
|
68
|
+
'closeAt',
|
|
69
|
+
'mergeAt',
|
|
70
|
+
'createdUser',
|
|
71
|
+
'created',
|
|
72
|
+
'updatedUser',
|
|
73
|
+
'updated',
|
|
74
|
+
'attachments',
|
|
75
|
+
'stars',
|
|
76
|
+
]),
|
|
53
77
|
handler: async ({ projectId, projectKey, repoId, repoName, ...params }) => {
|
|
54
78
|
const result = resolveIdOrKey('project', { id: projectId, key: projectKey }, t);
|
|
55
79
|
if (!result.ok) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { Entity } from 'backlog-js';
|
|
2
3
|
import { Backlog } from 'backlog-js';
|
|
3
4
|
import { ToolDefinition } from '../types/tool.js';
|
|
4
5
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
5
|
-
import { PullRequestCommentSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const addPullRequestCommentSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
projectId: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
projectKey: z.ZodOptional<z.ZodString>;
|
|
@@ -12,5 +12,5 @@ declare const addPullRequestCommentSchema: (t: DescriptionHelper["t"]) => {
|
|
|
12
12
|
content: z.ZodString;
|
|
13
13
|
notifiedUserId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
14
14
|
};
|
|
15
|
-
export declare const addPullRequestCommentTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addPullRequestCommentSchema>,
|
|
15
|
+
export declare const addPullRequestCommentTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addPullRequestCommentSchema>, Entity.PullRequest.Comment>;
|
|
16
16
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { buildToolSchema } from '../types/tool.js';
|
|
3
|
-
import {
|
|
3
|
+
import { outputFields } from '../types/outputFields.js';
|
|
4
4
|
import { resolveIdOrKey, resolveIdOrName } from '../utils/resolveIdOrKey.js';
|
|
5
5
|
const addPullRequestCommentSchema = buildToolSchema((t) => ({
|
|
6
6
|
projectId: z
|
|
@@ -35,7 +35,17 @@ export const addPullRequestCommentTool = (backlog, { t }) => {
|
|
|
35
35
|
name: 'add_pull_request_comment',
|
|
36
36
|
description: t('TOOL_ADD_PULL_REQUEST_COMMENT_DESCRIPTION', 'Adds a comment to a pull request'),
|
|
37
37
|
schema: z.object(addPullRequestCommentSchema(t)),
|
|
38
|
-
|
|
38
|
+
returnsList: false,
|
|
39
|
+
outputFields: outputFields()([
|
|
40
|
+
'id',
|
|
41
|
+
'content',
|
|
42
|
+
'changeLog',
|
|
43
|
+
'createdUser',
|
|
44
|
+
'created',
|
|
45
|
+
'updated',
|
|
46
|
+
'stars',
|
|
47
|
+
'notifications',
|
|
48
|
+
]),
|
|
39
49
|
importantFields: ['id', 'content', 'createdUser'],
|
|
40
50
|
handler: async ({ projectId, projectKey, repoId, repoName, number, ...params }) => {
|
|
41
51
|
const result = resolveIdOrKey('project', { id: projectId, key: projectKey }, t);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { Entity } from 'backlog-js';
|
|
2
3
|
import { Backlog } from 'backlog-js';
|
|
3
4
|
import { ToolDefinition } from '../types/tool.js';
|
|
4
5
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
5
|
-
import { RelatedIssueSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const addRelatedIssueSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
issueId: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
issueKey: z.ZodOptional<z.ZodString>;
|
|
9
9
|
targetIssueId: z.ZodNumber;
|
|
10
10
|
};
|
|
11
|
-
export declare const addRelatedIssueTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addRelatedIssueSchema>,
|
|
11
|
+
export declare const addRelatedIssueTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addRelatedIssueSchema>, Entity.Issue.RelatedIssue>;
|
|
12
12
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { buildToolSchema } from '../types/tool.js';
|
|
3
|
-
import {
|
|
3
|
+
import { outputFields } from '../types/outputFields.js';
|
|
4
4
|
import { resolveIdOrKey } from '../utils/resolveIdOrKey.js';
|
|
5
5
|
const addRelatedIssueSchema = buildToolSchema((t) => ({
|
|
6
6
|
issueId: z
|
|
@@ -20,7 +20,38 @@ export const addRelatedIssueTool = (backlog, { t }) => {
|
|
|
20
20
|
name: 'add_related_issue',
|
|
21
21
|
description: t('TOOL_ADD_RELATED_ISSUE_DESCRIPTION', 'Relates an issue to another issue'),
|
|
22
22
|
schema: z.object(addRelatedIssueSchema(t)),
|
|
23
|
-
|
|
23
|
+
returnsList: false,
|
|
24
|
+
outputFields: outputFields()([
|
|
25
|
+
'id',
|
|
26
|
+
'projectId',
|
|
27
|
+
'issueKey',
|
|
28
|
+
'keyId',
|
|
29
|
+
'issueType',
|
|
30
|
+
'summary',
|
|
31
|
+
'description',
|
|
32
|
+
'resolution',
|
|
33
|
+
'priority',
|
|
34
|
+
'status',
|
|
35
|
+
'assignee',
|
|
36
|
+
'category',
|
|
37
|
+
'versions',
|
|
38
|
+
'milestone',
|
|
39
|
+
'startDate',
|
|
40
|
+
'dueDate',
|
|
41
|
+
'estimatedHours',
|
|
42
|
+
'actualHours',
|
|
43
|
+
'parentIssueId',
|
|
44
|
+
'createdUser',
|
|
45
|
+
'created',
|
|
46
|
+
'updatedUser',
|
|
47
|
+
'updated',
|
|
48
|
+
'customFields',
|
|
49
|
+
'attachments',
|
|
50
|
+
'sharedFiles',
|
|
51
|
+
'stars',
|
|
52
|
+
'childIssueSummary',
|
|
53
|
+
'type',
|
|
54
|
+
]),
|
|
24
55
|
handler: async ({ issueId, issueKey, targetIssueId }) => {
|
|
25
56
|
const result = resolveIdOrKey('issue', { id: issueId, key: issueKey }, t);
|
|
26
57
|
if (!result.ok) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { Entity } from 'backlog-js';
|
|
2
3
|
import { Backlog } from 'backlog-js';
|
|
3
4
|
import { ToolDefinition } from '../types/tool.js';
|
|
4
5
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
5
|
-
import { VersionSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const addVersionMilestoneSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
projectId: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
projectKey: z.ZodOptional<z.ZodString>;
|
|
@@ -11,5 +11,5 @@ declare const addVersionMilestoneSchema: (t: DescriptionHelper["t"]) => {
|
|
|
11
11
|
startDate: z.ZodOptional<z.ZodString>;
|
|
12
12
|
releaseDueDate: z.ZodOptional<z.ZodString>;
|
|
13
13
|
};
|
|
14
|
-
export declare const addVersionMilestoneTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addVersionMilestoneSchema>,
|
|
14
|
+
export declare const addVersionMilestoneTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addVersionMilestoneSchema>, Entity.Project.Version>;
|
|
15
15
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { buildToolSchema } from '../types/tool.js';
|
|
3
|
-
import {
|
|
3
|
+
import { outputFields } from '../types/outputFields.js';
|
|
4
4
|
import { resolveIdOrKey } from '../utils/resolveIdOrKey.js';
|
|
5
5
|
const addVersionMilestoneSchema = buildToolSchema((t) => ({
|
|
6
6
|
projectId: z
|
|
@@ -32,7 +32,17 @@ export const addVersionMilestoneTool = (backlog, { t }) => {
|
|
|
32
32
|
name: 'add_version_milestone',
|
|
33
33
|
description: t('TOOL_ADD_VERSION_MILESTONE_DESCRIPTION', 'Creates a new version milestone'),
|
|
34
34
|
schema: z.object(addVersionMilestoneSchema(t)),
|
|
35
|
-
|
|
35
|
+
returnsList: false,
|
|
36
|
+
outputFields: outputFields()([
|
|
37
|
+
'id',
|
|
38
|
+
'projectId',
|
|
39
|
+
'name',
|
|
40
|
+
'description',
|
|
41
|
+
'startDate',
|
|
42
|
+
'releaseDueDate',
|
|
43
|
+
'archived',
|
|
44
|
+
'displayOrder',
|
|
45
|
+
]),
|
|
36
46
|
importantFields: [
|
|
37
47
|
'id',
|
|
38
48
|
'name',
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { Entity } from 'backlog-js';
|
|
2
3
|
import { Backlog } from 'backlog-js';
|
|
3
4
|
import { ToolDefinition } from '../types/tool.js';
|
|
4
5
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
5
|
-
import { WatchingListItemSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const addWatchingSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
issueIdOrKey: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
8
8
|
note: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
9
9
|
};
|
|
10
|
-
export declare const addWatchingTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addWatchingSchema>,
|
|
10
|
+
export declare const addWatchingTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addWatchingSchema>, Entity.WatchingList.WatchingListItem>;
|
|
11
11
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { buildToolSchema } from '../types/tool.js';
|
|
3
|
-
import {
|
|
3
|
+
import { outputFields } from '../types/outputFields.js';
|
|
4
4
|
const addWatchingSchema = buildToolSchema((t) => ({
|
|
5
5
|
issueIdOrKey: z
|
|
6
6
|
.union([z.number(), z.string()])
|
|
@@ -16,7 +16,17 @@ export const addWatchingTool = (backlog, { t }) => {
|
|
|
16
16
|
name: 'add_watching',
|
|
17
17
|
description: t('TOOL_ADD_WATCHING_DESCRIPTION', 'Adds a new watch to an issue'),
|
|
18
18
|
schema: z.object(addWatchingSchema(t)),
|
|
19
|
-
|
|
19
|
+
returnsList: false,
|
|
20
|
+
outputFields: outputFields()([
|
|
21
|
+
'id',
|
|
22
|
+
'resourceAlreadyRead',
|
|
23
|
+
'note',
|
|
24
|
+
'type',
|
|
25
|
+
'issue',
|
|
26
|
+
'lastContentUpdated',
|
|
27
|
+
'created',
|
|
28
|
+
'updated',
|
|
29
|
+
]),
|
|
20
30
|
handler: async ({ issueIdOrKey, note }) => backlog.postWatchingListItem({
|
|
21
31
|
issueIdOrKey,
|
|
22
32
|
note,
|
package/build/tools/addWiki.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { Entity } from 'backlog-js';
|
|
2
3
|
import { Backlog } from 'backlog-js';
|
|
3
4
|
import { ToolDefinition } from '../types/tool.js';
|
|
4
5
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
5
|
-
import { WikiSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const addWikiSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
projectId: z.ZodNumber;
|
|
8
8
|
name: z.ZodString;
|
|
9
9
|
content: z.ZodString;
|
|
10
10
|
mailNotify: z.ZodOptional<z.ZodBoolean>;
|
|
11
11
|
};
|
|
12
|
-
export declare const addWikiTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addWikiSchema>,
|
|
12
|
+
export declare const addWikiTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addWikiSchema>, Entity.Wiki.Wiki>;
|
|
13
13
|
export {};
|
package/build/tools/addWiki.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { buildToolSchema } from '../types/tool.js';
|
|
3
|
-
import {
|
|
3
|
+
import { outputFields } from '../types/outputFields.js';
|
|
4
4
|
const addWikiSchema = buildToolSchema((t) => ({
|
|
5
5
|
projectId: z.number().describe(t('TOOL_ADD_WIKI_PROJECT_ID', 'Project ID')),
|
|
6
6
|
name: z.string().describe(t('TOOL_ADD_WIKI_NAME', 'Name of the wiki page')),
|
|
@@ -17,7 +17,21 @@ export const addWikiTool = (backlog, { t }) => {
|
|
|
17
17
|
name: 'add_wiki',
|
|
18
18
|
description: t('TOOL_ADD_WIKI_DESCRIPTION', 'Creates a new wiki page'),
|
|
19
19
|
schema: z.object(addWikiSchema(t)),
|
|
20
|
-
|
|
20
|
+
returnsList: false,
|
|
21
|
+
outputFields: outputFields()([
|
|
22
|
+
'id',
|
|
23
|
+
'projectId',
|
|
24
|
+
'name',
|
|
25
|
+
'content',
|
|
26
|
+
'tags',
|
|
27
|
+
'attachments',
|
|
28
|
+
'sharedFiles',
|
|
29
|
+
'stars',
|
|
30
|
+
'createdUser',
|
|
31
|
+
'created',
|
|
32
|
+
'updatedUser',
|
|
33
|
+
'updated',
|
|
34
|
+
]),
|
|
21
35
|
importantFields: ['id', 'name', 'content', 'createdUser'],
|
|
22
36
|
handler: async ({ projectId, name, content, mailNotify }) => backlog.postWiki({
|
|
23
37
|
projectId,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { Entity } from 'backlog-js';
|
|
2
3
|
import { Backlog } from 'backlog-js';
|
|
3
4
|
import { ToolDefinition } from '../types/tool.js';
|
|
4
5
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
5
|
-
import { IssueCountSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const countIssuesSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
projectId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
8
8
|
issueTypeId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
@@ -44,5 +44,5 @@ declare const countIssuesSchema: (t: DescriptionHelper["t"]) => {
|
|
|
44
44
|
value: z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>;
|
|
45
45
|
}, z.core.$strip>], "type">>>;
|
|
46
46
|
};
|
|
47
|
-
export declare const countIssuesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof countIssuesSchema>,
|
|
47
|
+
export declare const countIssuesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof countIssuesSchema>, Entity.Issue.IssueCount>;
|
|
48
48
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { buildToolSchema } from '../types/tool.js';
|
|
3
|
-
import {
|
|
3
|
+
import { outputFields } from '../types/outputFields.js';
|
|
4
4
|
import { customFieldFiltersToPayload } from '../backlog/customFields.js';
|
|
5
5
|
import { buildCustomFieldFilterSchema } from './shared/customFieldFiltersSchema.js';
|
|
6
6
|
const countIssuesSchema = buildToolSchema((t) => ({
|
|
@@ -94,7 +94,8 @@ export const countIssuesTool = (backlog, { t }) => {
|
|
|
94
94
|
name: 'count_issues',
|
|
95
95
|
description: t('TOOL_COUNT_ISSUES_DESCRIPTION', 'Returns count of issues'),
|
|
96
96
|
schema: z.object(countIssuesSchema(t)),
|
|
97
|
-
|
|
97
|
+
returnsList: false,
|
|
98
|
+
outputFields: outputFields()(['count']),
|
|
98
99
|
handler: async ({ customFields, ...rest }) => {
|
|
99
100
|
return backlog.getIssuesCount({
|
|
100
101
|
...rest,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { Entity } from 'backlog-js';
|
|
2
3
|
import { Backlog } from 'backlog-js';
|
|
3
4
|
import { ToolDefinition } from '../types/tool.js';
|
|
4
5
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
5
|
-
import { IssueSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const deleteIssueSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
issueId: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
issueKey: z.ZodOptional<z.ZodString>;
|
|
9
9
|
};
|
|
10
|
-
export declare const deleteIssueTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof deleteIssueSchema>,
|
|
10
|
+
export declare const deleteIssueTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof deleteIssueSchema>, Entity.Issue.Issue>;
|
|
11
11
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { buildToolSchema } from '../types/tool.js';
|
|
3
|
-
import {
|
|
3
|
+
import { outputFields } from '../types/outputFields.js';
|
|
4
4
|
import { resolveIdOrKey } from '../utils/resolveIdOrKey.js';
|
|
5
5
|
const deleteIssueSchema = buildToolSchema((t) => ({
|
|
6
6
|
issueId: z
|
|
@@ -17,7 +17,37 @@ export const deleteIssueTool = (backlog, { t }) => {
|
|
|
17
17
|
name: 'delete_issue',
|
|
18
18
|
description: t('TOOL_DELETE_ISSUE_DESCRIPTION', 'Deletes an issue'),
|
|
19
19
|
schema: z.object(deleteIssueSchema(t)),
|
|
20
|
-
|
|
20
|
+
returnsList: false,
|
|
21
|
+
outputFields: outputFields()([
|
|
22
|
+
'id',
|
|
23
|
+
'projectId',
|
|
24
|
+
'issueKey',
|
|
25
|
+
'keyId',
|
|
26
|
+
'issueType',
|
|
27
|
+
'summary',
|
|
28
|
+
'description',
|
|
29
|
+
'resolution',
|
|
30
|
+
'priority',
|
|
31
|
+
'status',
|
|
32
|
+
'assignee',
|
|
33
|
+
'category',
|
|
34
|
+
'versions',
|
|
35
|
+
'milestone',
|
|
36
|
+
'startDate',
|
|
37
|
+
'dueDate',
|
|
38
|
+
'estimatedHours',
|
|
39
|
+
'actualHours',
|
|
40
|
+
'parentIssueId',
|
|
41
|
+
'createdUser',
|
|
42
|
+
'created',
|
|
43
|
+
'updatedUser',
|
|
44
|
+
'updated',
|
|
45
|
+
'customFields',
|
|
46
|
+
'attachments',
|
|
47
|
+
'sharedFiles',
|
|
48
|
+
'stars',
|
|
49
|
+
'childIssueSummary',
|
|
50
|
+
]),
|
|
21
51
|
handler: async ({ issueId, issueKey }) => {
|
|
22
52
|
const result = resolveIdOrKey('issue', { id: issueId, key: issueKey }, t);
|
|
23
53
|
if (!result.ok) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { Entity } from 'backlog-js';
|
|
2
3
|
import { Backlog } from 'backlog-js';
|
|
3
4
|
import { ToolDefinition } from '../types/tool.js';
|
|
4
5
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
5
|
-
import { ProjectSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const deleteProjectSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
projectId: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
projectKey: z.ZodOptional<z.ZodString>;
|
|
9
9
|
};
|
|
10
|
-
export declare const deleteProjectTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof deleteProjectSchema>,
|
|
10
|
+
export declare const deleteProjectTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof deleteProjectSchema>, Entity.Project.Project>;
|
|
11
11
|
export {};
|